2016

Table Of Contents
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.
LOCATE AND IMPORT A TEXT FILE
tell text box 2
try
set story 1 to alias (thepath & "ASB Text")
on error
set story 1 to (choose file with prompt "Please select the file
\"ASB Text\"" of type {"TEXT"})
end try
end tell
CONCEPTS
The statements above are similar to locating and importing a text file in the
Get Text dialog box.
The
try
statement looks for the “ASB Text”le in the location previously
defined by
thepath
(see the “Establish the path” portion near the beginning
of the “Breakdown of the Layout Construction Scriptsection of this document).
If the file exists in this location, the
set
event imports the “ASB Text” file,
replacing the story in the text box.
If “ASB Text” does not exist in the location defined by
thepath
, the script will
continue with the
on error
statement. (The le will only be located by
thepath
if your hard drive and folders are named the same as those defined in
thepath
.)
The first parameter is a message to the user shown at the bottom of the dialog
box, “Open the file named ‘ASB Text.’” The second parameter stores the path
to the textle in an address this path is used to import the text file. The third
parameter is the signature for a textle (le type). Once the user locates the text
file and clicks OK, the set event imports the text.
If you want to open a QuarkXPress layout using the
getFileDialog
script,
the signature would be “XDOC.” This limits the displayed files to QuarkXPress
layouts. This is an optional parameter.
FORMAT THE BODY COPY
set size of story 1 to 11
set leading of story 1 to 43
set justification of story 1 to fully justified
set font of story 1 to "Times"
end tell
SCRIPT WRITING SAMPLE
24
|
A GUIDE TO APPLE EVENTS SCRIPTING