Whether they are visible or not, every Keynote slide incorporates, by default, two text containers: one for the slide title; and one for the slide body. The visibility of these text items is determined by the state of the Appearance checkboxes in the Slide Layout pane of the Format tab. (⬇ see image below )
The dictionary entry for the slide class contains properties for determining visibility of these default text items, and well references to the objects, enabling the ability to set and format their text contents.
The Default Text Item Properties (Excerpt from Slide Class)
sliden : [inh. iWork container; see also Compatibility Suite] : A slide in a presentation document.
properties
body showing ( boolean ) : Is the default body text item visible on the slide?
default body item ( text item r/o ) : The default text item container for the body text of the slide. Its visibility is determined by the value of the body showing property.
default title item ( text item r/o ) : The default text item container for the title text of the slide. Its visibility is determined by the value of the title showing property.
title showing ( boolean ) : Is the default title text item visible on the slide?
Master Slides and Default Text Items
The following illustrations show how default text items are used in standard master slide designs:
(⬆ see above ) Title & Subtitle • This slide master design incorporates a default text item for the title 1 and a default text item for the subtitle 2 . Their visibility is determined by the status of their corresponding checkboxes.
(⬆ see above ) Title – Center • This slide master design incorporates a default text item for the title 1 and no default text item for a subtitle or body. Note that the checkbox for controlling the default body text item is unselected 2 .
(⬆ see above ) Title, Bullets & Photo • This slide master design incorporates a default text item for the title 1 and a default text item for the bullet list 2 .
(⬆ see above ) Blank • This slide master design incorporates no default text items, as indicated by the corresponding checkboxes for title 1 and body 2 .
Setting the Values of the Default Text Items
A slide’s default text items are elements of the text item class, inheriting from iWork items of the iWork Suite. The object text property of the text item class represents the text contents of the text item. Change the value of this property, and you change the contents of the text item. Unless specified otherwise, the formatting of a default text item assumes the styling of its related master slide.
NOTE: see the text item topic for details on applying styling to object text.
Text Item Properties (Excerpt from Text Item Class)
text itemn : [inh. iWork item : A text container.
properties
object text ( rich text ) : The text contained within the text item.
The following script demonstrates how to set the content of the default text items of created slides:
Setting Default Text Items Example
01
propertythisThemeName : "Black"
02
03
tellapplication "Keynote"
04
activate
05
try
06
-- GET THE THEME NAMES
07
set thethemeNamesto thenameof everytheme
08
09
-- CHECK FOR THEME
10
ifthisThemeNameis not in thethemeNamesthen
11
error "The theme “" & thisThemeName & "” is not installed on this computer."
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. MACOSXAUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. MACOSXAUTOMATION.COM provides this only as a convenience to our users. MACOSXAUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and MACOSXAUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from MACOSXAUTOMATION.COM and that MACOSXAUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.