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


OSASetResumeDispatchProc

You can use the OSASetResumeDispatchProc function to set the resume dispatch function called by a scripting component during execution of an AppleScript continue statement or its equivalent.

FUNCTION OSASetResumeDispatchProc 
                        (scriptingComponent: ComponentInstance; 
                         resumeDispatchProc: AEHandlerProcPtr; 
                         refCon: LongInt): OSAError;
scriptingComponent
A component instance created by a prior call to the Component Manager function OpenDefaultComponent or OpenComponent (see page 10-4).
resumeDispatchProc
You can specify one of the following in this parameter:
refCon
A reference constant. Specify kOSADontUsePhac in this parameter and kOSAUseStandardDispatch in the resumeDispatchProc parameter to request standard Apple event dispatching excluding the special handler dispatch table.
DESCRIPTION
The OSASetResumeDispatchProc function sets the resume dispatch function that the specified instance of a scripting component calls during execution of an AppleScript continue statement or its equivalent. The resume dispatch function should dispatch the event to the application's standard handler for that event.

If you are using a general handler similar to that in Listing 10-7 on page 10-21 for preliminary processing of Apple events, and if you can rely on standard Apple event dispatching to dispatch the event correctly, you don't need to provide a resume dispatch function. Instead, you can specify kOSAUseStandardDispatch as the value of the resumeDispatchProc parameter and the constant kOSADontUsePhac as the value of the refCon parameter. This causes the Apple Event Manager to use standard Apple event dispatching except that it bypasses your application's special handler dispatch table and thus won't call your general Apple event handler recursively.

RESULT CODES
noErr0No error
errOSASystemError-1750General scripting system error
badComponentInstance$80008001Invalid component instance
SEE ALSO
For more information about resume dispatch functions, see "Supplying a Resume Dispatch Function" on page 10-21 and the description of a resume dispatch function on page 10-95.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996