2017

Table Of Contents
CREATE THE FIRST TEXT BOX
tell page 1 of layout space 1
make text box at beginning with properties
{bounds:{"2 cm", "5 cm", "8 cm", "19 cm"}}
CONCEPTS
The lines above are similar to creating a text box with the rectangular Text Box
tool, and then sizing and positioning it using the Measurements palette.
The
tell
statement references the first
page
of the left-most
layout space;
both are referenced by index [1].
If you want to see an object after it is created (and while the script is running),
add the line
show
or
show(it)
. This places the current object in the upper-left
corner of the layout window.
ENTER THE HEADLINE INTO A TEXT BOX
tell text box 1
set vertical justification to bottom justified
set color to "None"
end tell
tell story 1 of text box 1 of page 1 of layout space 1
set contents of it to "Biking Gear"
end tell
CONCEPTS
The statements above are similar to specifying a vertical alignment and back-
ground color in the Text tab of the Modify dialog box, and then entering
“Biking Gear” in the text box.
The
tell
statement references the first text box by index [1].
The next two
set
events change the vertical justification to bottom and the
background color to None.
The
tell
statement references the story in the active text box; both are
referenced by index [1]. (Only one story is possible per text box or chain of
linked text boxes.)
The
set
event specifies
it
(
it
refers to the story, the last object referenced in
the
with
statement). The text “Biking Gear” is entered into the text box. It is
then formatted with properties defined in the Normal style sheet for the
default layout.
SCRIPT WRITING SAMPLE
22
|
A GUIDE TO APPLE EVENTS SCRIPTING