Important: The information in this document is obsolete and should not be used for new development.
OSAStartRecording
You can use theOSAStartRecording
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 functionOpenDefaultComponent
orOpenComponent
(see page 10-4).compiledScriptToModifyID
- The script ID for the compiled script in which to record.
DESCRIPTION
TheOSAStartRecording
routine turns on Apple event recording. Subsequent Apple events are recorded (that is, appended to any existing statements) in the compiled script specified by thecompiledScriptToModifyID
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 thecompiledScriptToModifyID
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
noErr 0 No error errAERecordingIsAlreadyOn -1732 Attempt to turn recording on when it is already on for a recording process errOSASystemError -1750 General scripting system error errOSAInvalidID -1751 Invalid script ID badComponentInstance $80008001 Invalid 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.