Important: The information in this document is obsolete and should not be used for new development.
ASInit
You can use theASInit
function to initialize the AppleScript component.
FUNCTION ASInit (scriptingComponent: ComponentInstance; modeFlags: LongInt; minStackSize: LongInt; preferredStackSize: LongInt; maxStackSize: LongInt; minHeapSize: LongInt; preferredHeapSize: LongInt; maxHeapSize: LongInt): OSAError;
scriptingComponent
- A component instance created by a prior call to the Component Manager function
OpenDefaultComponent
orOpenComponent
(see page 10-4).modeFlags
- Reserved for future use. Set to
kOSAModeNull
.minStackSize
- The minimum size for the portion of the application's heap used by the AppleScript component's application-specific stack.
preferredStackSize
- The preferred size for the portion of the application's heap used by the AppleScript component's application-specific stack.
maxStackSize
- The maximum size for the portion of the application's heap used by the AppleScript component's application-specific stack.
minHeapSize
- The minimum size for the portion of the application's heap used by the AppleScript component's application-specific heap.
preferredHeapSize
- The preferred size for the portion of the application's heap used by the AppleScript component's application-specific heap.
maxHeapSize
- The maximum size for the portion of the application's heap used by the AppleScript component's application-specific heap.
DESCRIPTION
Your application should set themodeFlags
parameter tokOSAModeNull
. You can use the other parameters to specify memory sizes for the portion of your application's heap used by the AppleScript component for its application-specific heap and stack. If your application sets any of these parameters to 0, the AppleScript component uses the corresponding value in your application's'scsz'
resource. If that value is also set to 0, the AppleScript component uses the corresponding default value:
CONST kASDefaultMinStackSize = 1 * 1024; kASDefaultPreferredStackSize = 4 * 1024; kASDefaultMaxStackSize = 16 * 1024; kASDefaultMinHeapSize = 4 * 1024; kASDefaultPreferredHeapSize = 64 * 1024; kASDefaultMaxHeapSize = 32 * 1024 * 1024;If your application doesn't callASInit
explicitly, the AppleScript component initializes itself using the values specified in your application's'scsz'
resource when your application first calls any scripting component routine. If any of these values are set to 0, the AppleScript component uses the corresponding default value.If your application doesn't call
ASInit
explicitly and doesn't call any scripting component routines, the AppleScript component will not be initialized. For example, if your application opens and closes the AppleScript component or calls Component Manager routines such asOpenDefaultComponent
orFindNextComponent
but doesn't call any scripting component routines, the AppleScript component is not initialized.When the AppleScript component is initialized, it uses your application's high memory to create the blocks that it locks for its own use. If you expect to lock any portion of high memory for a shorter time than you expect the AppleScript component to be available, you should call
ASInit
explicitly.RESULT CODES
noErr 0 No error errOSASystemError -1750 General scripting system error badComponentInstance $80008001 Invalid component instance