2017

Table Of Contents
FORMAT THE HEADLINE
set font to "Times"
set size of word 1 to 30
set style of word 1 to all caps
set base shift of word 1 to 60
set track of word 1 to 50
set kern of last character of word 1 to -100
set size of word 2 to 120
set color of word 2 to "Blue"
set style of word 2 to italic
set kern of character 1 of word 2 to -5
set kern of character 2 of word 2 to -5
end tell
CONCEPTS
The set statements above are comparable to the Font, Size, Type Style,
Color, Baseline Shift, Track, and Kern commands in the Style menu.
The first
set
event changes the font for the story to Times.
The next four
set
events reference the first word by index [1]. The size, text
style, baseline shift, and track properties of the word “Biking” are changed.
The next
set
event references the last character of therst word; the character is
referenced by relative position. The kern property is changed to –100. (To kern
the space between two words, reference the last character of the first word.)
The next three
set
events reference the second word by index [2]. The size,
color, and type style properties of the word “Gear” are changed.
The last two
set
events reference the first and second character of the second
word; all are referenced by index. The kern property of each character is
changed to –5. (To kern a pair of characters, you only need to reference the
first character.)
CREATE THE SECOND TEXT BOX
tell page 1 of layout space 1
make text box at end with properties
{bounds:{"8.5 cm", "5 cm", "29.959 cm", "18.472 cm"}}
end tell
SCRIPT WRITING SAMPLE
A GUIDE TO APPLE EVENTS SCRIPTING
|
23