Language Guide

CHAPTER 9
Script Objects
Inheritance and Delegation 271
Note
The distinction between defining a script object and
initializing a script object is similar to the distinction
between a class and an instance in object-oriented design.
When you define a script object, you define a class of
objects that respond to the same commands. When
AppleScript initializes a script object, it creates an instance
of the class. The script object gets its initial context
(property values and handlers) from the script object
definition, but its context can change as it responds to
commands.
Inheritance and Delegation 9
You can use AppleScript’s inheritance mechanism to define related script
objects in terms of one another. This allows you to share property and handler
definitions among many script objects without repeating the shared definitions.
This section describes
how to a define a script object that inherits properties and handlers from
another script object
how inheritance works
how to use the Continue statement to extend the behavior of an inherited
handler without completely replacing it
Defining Inheritance 9
You define inheritance with the Parent property. A script object that includes a
Parent property inherits the properties and handlers of the script object listed
in the Parent property.
The script object listed in a Parent property definition is called the parent
script object, or parent. A script object that includes a Parent property is
referred to as a child script object, or child. The Parent property is not required.
A script object can have many children, but a child script object can have only
one parent.