Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 10 - Scripting Components / Scripting Components Reference


Data Structures

This section describes the principal data structures and Component Manager type codes used by the standard scripting component routines. Data structures used by individual routines are described with the appropriate routines in the sections that follow.

The Component Manager type code for components that support the standard scripting component routines is 'osa ', and the subtype code for the generic scripting component is 'scpt'.

CONST
   kOSAComponentType                      = 'osa ';
   kOSAGenericScriptingComponentSubtype   = 'scpt';
Because all results returned by the Component Manager are of type ComponentResult (a long integer), scripting components also define this type for result codes.

TYPE
   OSAError = ComponentResult;
Scripting components keep track of script data in memory by means of script IDs of type OSAID.

TYPE OSAID = LongInt; 
A scripting component assigns a script ID when it creates the associated script data (that is, a compiled script, a script value, a script context, or other kinds of script data supported by a scripting component) or loads it into memory. The scripting routines that create, load, compile, and execute scripts all return script IDs, and your application must pass valid script IDs to the other routines that manipulate scripts. A script ID remains valid until a client application calls OSADispose to reclaim the memory used for the corresponding script data.

If the execution of a script does not result in a value, OSAExecute returns the constant kOSANullScript as the script ID. If a client application passes kOSANullScript to the OSAGetSource function instead of a valid script ID, the scripting component should display a null source description (possibly an empty text string). If a client application passes kOSANullScript to OSAStartRecording, the scripting component creates a new compiled script for editing or recording.

CONST kOSANullScript = 0;

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996