C H A P T E R 4
Double Angle Brackets in Results and Scripts
5/5/99 ã Apple Computer, Inc.
You’re creating a script at home to use on a work machine that is running a
newer version of the Mac OS or a newer version of a scriptable application or
scripting addition. Drawing from the example in “When a Dictionary Is Not
Available” (page 123), suppose you want to use the scripting addition
command Delay, but are running Mac OS 8, which doesn’t support that
command. At home, you can write
«event sysodela» 4
in your script. When
you open the script at work, AppleScript converts the term to
problem with this approach is that you can’t check the validity of your script
until you try it on the target machine.
You know that an application supports a certain Apple event but it doesn’t
supply terminology for the event in its dictionary. For example, if you’re a
developer creating a scriptable application, you may want to test a feature
you’ve added to the code but not yet added to the application’s dictionary.
You can also use AppleScript to insert chevrons into a script, using the
1. Create a script using standard terms compiled against an available
application or scripting addition.
2. Save the script as text and quit the Script Editor.
3. Remove the application or scripting addition from the computer.
4. Open the script again and compile it.
5. When AppleScript asks you to locate the application or scripting addition,
specify a ﬁle that doesn’t contain a terminology.
The script will compile successfully, but the Script Editor will display the script
with chevron format for any terms that rely on a missing dictionary. (To
recompile the script again and supply the correct dictionary, save it as text and
quit the Script Editor again, then open and recompile it, specifying the correct
application or scripting addition.)
There are several situations in which you might want to recompile a script this
You’re creating a script that will target an application on a remote machine.
AppleScript doesn’t currently allow you to compile against the dictionary of
an application or scripting addition on a remote machine. If you compile
using a local copy of the application, you are not only using its dictionary
(which may be the same as for the remote application), you are also targeting
the local application. However, you can write and compile the script with the
local version of the application, insert chevrons as described above so that