Scripting Additions Guide

CHAPTER 3
Writing Scripting Additions
86 Types of Scripting Additions
A scripting addition resource file may contain up to four kinds of resource:
(1) a code resource of type 'osax' that contains the executable code for the
scripting addition, (2) an 'aete' resource that describes the terminology
provided by the scripting addition, (3) a resource of type 'osiz' that informs
AppleScript whether the scripting addition has any owned resources and
whether it responds to commands sent from other computers on a network,
and (4) any owned resources for the scripting addition, such as dialog
definitions, strings, and sounds.
The next two sections describe the differences between 'osax' resources
for Apple event handlers and 'osax' resources for Apple event coercions.
For information about writing an 'aete' resource, see Inside Macintosh:
Interapplication Communication. “The Scripting Addition Size Resource,” which
begins on page 89, describes the format of the 'osiz' resource.
Apple Event Handler Scripting Addition 3
The 'osax' resource for an Apple event handler follows the following
convention:
The letters AEVT in the resource name indicate that the scripting addition uses
the event handler interface. The next eight characters represent the event’s class
and ID.
The 'osax' code resource for a scripting addition handler is in the form of
an Apple event handler. The entry point for the code resource must follow the
Apple event handler function interface as follows:
In C,
pascal OSErr MyAEHandlerFunction (AppleEvent theEvent,
AppleEvent theReply,
long theRefCon);
Resource type 'osax'
Resource ID An identifier (for example, 6991)
Resource name 'AEVTclssidid'