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
Generic Scripting Component Routines / Using Component-Specific Routines


OSARealToGenericID

You can use the OSARealToGenericID function to convert a component-specific script ID to the corresponding generic script ID.

FUNCTION OSARealToGenericID
               (genericScriptingComponent: ComponentInstance;
                VAR theScriptID: OSAID;
                theExactComponent: ComponentInstance)
                : OSAError;
genericScriptingComponent
A component instance for the generic scripting component, created by a prior call to the Component Manager function OpenDefaultComponent or OpenComponent (see page 10-4).
theScriptID
The component-specific script ID that you want to convert. You must have obtained this script ID from the scripting component instance passed in the theExactComponent parameter. The OSARealToGenericID function returns, in this parameter, the generic script ID that corresponds to the component-specific script ID that you pass in this parameter.
theExactComponent
A scripting component instance returned by a generic scripting component routine.
DESCRIPTION
The OSARealToGenericID function performs the reverse of the task performed by OSAGenericToRealID. Given a component-specific script ID and an exact scripting component instance (that is, the component instance that created the component-specific script ID), the OSARealToGenericID function returns the corresponding generic script ID. The OSARealToGenericID function modifies the script ID in place, changing the component-specific script ID passed in the theScriptID parameter to the corresponding generic script ID.

You'll need to do this if you have obtained a component-specific script ID using an exact scripting component instance and you want to refer to the same script in calls that use an instance of the generic scripting component. You can't use a component-specific script ID with the generic scripting component.

The script ID you pass in the theScriptID parameter must be a component-specific script ID obtained from a scripting component instance known to the generic scripting component. You can obtain such an instance by calling either OSAGetScriptingComponent or OSAGenericToRealID.

RESULT CODES
noErr0No error
errOSAComponentMismatch-1761The theScriptID and theExactComponent parameters are for two different scripting components
errOSACantOpenComponent-1762Can't connect to scripting component
badComponentInstance$80008001Invalid component instance

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996