Language Guide
About Script Objects 265
CHAPTER 9
Script Objects 9
Figure 9-0
Listing 9-0
Table 9-0
Script objects are objects that you define and use in scripts. Like the application
and system objects described earlier in this manual, script objects have
properties and can respond to commands. Unlike application or system objects,
script objects are defined within scripts.
This chapter describes how to define and use script objects. It begins by describ-
ing a simple script object definition and demonstrating how you would send a
command to the resulting script object. Subsequent sections describe in more
detail how to define, send commands to, and initialize script objects.
You can define groups of script objects that share properties and handlers, and
you can extend the behavior of a handler in one script object by calling it from
another script object. The section “Inheritance and Delegation” describes how
this works. If you are familiar with object-oriented design, you may recognize
the techniques described in this section.
The last section, “Using the Copy and Set Commands With Script Objects,”
describes what to expect when you set a variable to a script object or copy a
script object to a variable and how to write a handler that creates copies
of script objects.
About Script Objects 9
Script objects are user-defined objects that combine data (in the form of
properties) and potential actions (in the form of handlers). Script object
definitions are compound statements that can contain collections of properties,
handlers, and other AppleScript statements.