Scripting Additions Guide

CHAPTER 3
Writing Scripting Additions
Scripting Addition Limitations 93
For an example of this technique in action, see the reply returned by the
Display Dialog scripting addition.
Scripting Addition Limitations 0
Scripting additions are stand-alone code resources. As such they cannot have
global variables. Solutions are available to circumvent this limitation in code
resources. Check your compiler documentation for these solutions or see the
appropriate technical notes from Apple Computer.
Scripting additions cannot use the Object Support Library (OSL). The OSL is
designed to be linked into an application and initialized once. This means that
a scripting addition that has to resolve object specifier records must do so
internally without the use of the OSL.
Scripting additions are not chained. If two or more scripting additions in
the Scripting Additions folder have the same class and ID, only the first one
found (that is, the first one in alphabetical order by name) will be installed.
Sample Scripting Addition 0
Listing 3-3 demonstrates the basic structure of a scripting addition handler and
its associated 'aete' resource. It is called “Play Sound Scripting Addition”
and is written in MPW C.