2017

Table Of Contents
CONCEPTS
The statements above are similar to creating a picture box and importing a
picture. The properties are then specified with
set
events.
The
tell
statement references the first page of the left-most layout; both are
referenced by index [1].
The
make
event makes a picture box using the specified properties.
The second
tell
statement references the third picture box by index [3].
The four parameters indicate how far from the top-left corner of the layout page
the top, left, bottom, and right sides of the box will be positioned.
The background color property of the picture box is set to None in the
make
statement.
The
try
statement looks for the “Helmet.tiff” file in the location previously
defined by
thepath
. If the file exists in this location, the
set
event specifies
“Helmet.tiff” as the image in the second picture box.
If “Helmet.tiffdoes not exist in the location defined by
thepath
, the script will
continue with the
on error
statement. This statement handles error conditions
by providing another set of instructions if an error occurs.
The first string is a message to the user shown at the bottom of the dialog box,
“Please select the file ‘Helmet.tiff.’” Once the user locates the image file and
clicks OK, the
set
event imports the image.
The third
set
event sets the scale property of the image to 70%. The last
set
event sets the offset property of the image in centimeters.
CREATE A VERTICAL LINE
tell page 1 of layout space 1 of project 1
make line box at end with properties
(left point:{"0 cm", "21.406 cm"},
right point:{"8 cm", "21.406 cm"}}
tell line box 1
set color to "Magenta"
set width to 3
set style to dotted
end tell
SCRIPT WRITING SAMPLE
30
|
A GUIDE TO APPLE EVENTS SCRIPTING