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
Optional Scripting Component Routines / Using Script Contexts to Handle Apple Events


OSAMakeContext

You can use the OSAMakeContext function to get a script ID for a new script context.

FUNCTION OSAMakeContext(scriptingComponent: ComponentInstance;
                        contextName: AEDesc;
                        parentContext: OSAID;
                        VAR resultingContextID: OSAID): OSAError;
scriptingComponent
A component instance created by a prior call to the Component Manager function OpenDefaultComponent or OpenComponent (see page 10-4).
contextName
Name of new context. Some scripting components may use context names for semantic purposes. If the value of this parameter is typeNull, OSAMakeContext creates an unnamed context.
parentContext
Existing context from which new context inherits bindings. If the value of this parameter is kOSANullScript, the new context does not inherit bindings from any other context.
resultingContextID
A script ID for the resulting script context.
DESCRIPTION
The OSAMakeContext function creates a new script context that you may pass to OSAExecute or OSAExecuteEvent. The new script context inherits the bindings of the script context specified in the parentContext parameter.

SPECIAL CONSIDERATIONS
If you call OSAMakeContext using an instance of the generic scripting component, the generic scripting component uses the default scripting component to create the new script context.

RESULT CODES
noErr0No error
errOSACantCoerce-1700Invalid context name
errOSASystemError-1750General scripting system error
errOSAInvalidID-1751Invalid script ID
badComponentInstance$80008001Invalid component instance D
SEE ALSO
To compile existing source data into a script context, use OSACompile as described on page 10-47.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996