Important: The information in this document is obsolete and should not be used for new development.
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 typeComponentResult
(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 typeOSAID
.
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 callsOSADispose
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 constantkOSANullScript
as the script ID. If a client application passeskOSANullScript
to theOSAGetSource
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 passeskOSANullScript
toOSAStartRecording
, the scripting component creates a new compiled script for editing or recording.
CONST kOSANullScript = 0;