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 / Recording Scripts


OSAStartRecording

You can use the OSAStartRecording routine to turn on Apple event recording and record subsequent Apple events in a compiled script.

FUNCTION OSAStartRecording
                  (scriptingComponent: ComponentInstance;
                   VAR compiledScriptToModifyID: OSAID): OSAError;
scriptingComponent

A component instance created by a prior call to the Component Manager function OpenDefaultComponent or OpenComponent (see page 10-4).
compiledScriptToModifyID
The script ID for the compiled script in which to record.
DESCRIPTION
The OSAStartRecording routine turns on Apple event recording. Subsequent Apple events are recorded (that is, appended to any existing statements) in the compiled script specified by the compiledScriptToModifyID parameter. If the source data for the compiled script is currently displayed in a script editor's window, the script editor's handler for the Recorded Text event should display each new statement in the window as it is recorded. Users should not be able to change a script that is open in a script editor window while it is being recorded into.

To record into a new compiled script, pass the constant kOSANullScript in the compiledScriptToModifyID parameter. The scripting component should respond by creating a new compiled script and recording into that.

SPECIAL CONSIDERATIONS
The generic scripting component uses its default scripting component to create and record into a new compiled script.

RESULT CODES
noErr0No error
errAERecordingIsAlreadyOn-1732Attempt to turn recording on when it is already on for a recording process
errOSASystemError-1750General scripting system error
errOSAInvalidID-1751Invalid script ID
badComponentInstance$80008001Invalid component instance
SEE ALSO
For more information about the default scripting component associated with any instance of the generic scripting component, see "Generic Scripting Component Routines," which begins on page 10-83.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996