Important: The information in this document is obsolete and should not be used for new development.
Chapter 10 - Scripting Components
This chapter describes how your application can use the Component Manager and scripting components to manipulate and execute scripts.Before you read this chapter, you should read the chapter "Introduction to Scripting" in this book and the chapters about the Apple Event Manager that are relevant to your application.
Your application can use the standard scripting component data structures and routines described in this chapter to manipulate scripts written in any scripting language based on the Open Scripting Architecture (OSA). Your application need not be scriptable or recordable to use these routines. However, if your application is scriptable, you can easily make it capable of manipulating and executing scripts that control its own behavior.
The first section in this chapter describes how to establish a connection with a scripting component. The next two sections provide
The section "Scripting Components Reference" describes, in addition to the standard scripting component routines, routines provided by the AppleScript component, routines provided by the generic scripting component, and routines called by scripting components.
- examples of how to use the standard scripting component routines
- information for developers of scripting components
If you are developing a scripting component, you should also read the instructions for creating components in the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox.
Chapter Contents
- Connecting to a Scripting Component
- Using Scripting Component Routines
- Compiling and Executing Source Data
- Saving Script Data
- Storage Formats for Script Data
- Resource and File Types for Script Data
- Loading and Executing Script Data
- Modifying and Recompiling a Compiled Script
- Using a Script Context to Handle an Apple Event
- Supplying a Resume Dispatch Function
- Supplying an Alternative Active Function
- Supplying Alternative Create and Send Functions
- Alternative Create Functions
- Alternative Send Functions
- Recording Scripts
- Writing a Scripting Component
- Scripting Components Reference
- Data Structures
- Required Scripting Component Routines
- Saving and Loading Script Data
- Executing and Disposing of Scripts
- Setting and Getting Script Information
- Manipulating the Active Function
- Optional Scripting Component Routines
- Compiling Scripts
- Getting Source Data
- Coercing Script Values
- Manipulating the Create and Send Functions
- Recording Scripts
- Executing Scripts in One Step
- Manipulating Dialects
- Using Script Contexts to Handle Apple Events
- AppleScript Component Routines
- Initializing AppleScript
- Getting and Setting Styles for Source Data
- Generic Scripting Component Routines
- Getting and Setting the Default Scripting Component
- Using Component-Specific Routines
- Routines Used by Scripting Components
- Manipulating Trailers for Generic Storage Descriptor Records
- Application-Defined Routines
- Summary of Scripting Components
- Pascal Summary
- Constants
- Data Types
- Required Scripting Component Routines
- Saving and Loading Script Data
- Executing and Disposing of Scripts
- Setting and Getting Script Information
- Manipulating the Active Function
- Optional Scripting Component Routines
- Compiling Scripts
- Getting Source Data
- Coercing Script Values
- Manipulating the Create and Send Functions
- Recording Scripts
- Executing Scripts in One Step
- Manipulating Dialects
- Using Script Contexts to Handle Apple Events
- AppleScript Component Routines
- Initializing AppleScript
- Getting and Setting Styles for Source Data
- Generic Scripting Component Routines
- Getting and Setting the Default Scripting Component
- Using Component-Specific Routines
- Routines Used by Scripting Components
- Manipulating Trailers for Generic Storage Descriptor Records
- Application-Defined Routines
- C Summary
- Constants
- Data Types
- Required Scripting Component Routines
- Saving and Loading Script Data
- Executing and Disposing of Scripts
- Setting and Getting Script Information
- Manipulating the Active Function
- Optional Scripting Component Routines
- Compiling Scripts
- Getting Source Data
- Coercing Script Values
- Manipulating the Create and Send Functions
- Recording Scripts
- Executing Scripts in One Step
- Manipulating Dialects
- Using Script Contexts to Handle Apple Events
- AppleScript Component Routines
- Initializing AppleScript
- Getting and Setting Styles for Source Data
- Generic Scripting Component Routines
- Getting and Setting the Default Scripting Component
- Using Component-Specific Routines
- Routines Used by Scripting Components
- Manipulating Trailers for Generic Storage Descriptor Records
- Application-Defined Routines
- Result Codes