Language Guide
CHAPTER 9
Script Objects
Inheritance and Delegation 277
The Continue Statement 9
Normally, if a child script object and its parent both have handlers for the same
command, the child uses its own handler. However, the handler in a child
script object can handle a command first, and then use a Continue statement to
call the handler for the same command in the parent.
The use of a Continue statement to call a handler in a parent script object is
called delegation. By delegating commands to a parent script object, a child
can extend the behavior of a handler contained in the parent without having to
repeat the entire handler definition. After the parent handles the command,
AppleScript continues at the place in the child where the Continue statement
was called. Handlers in child script objects that contain Continue statements
are similar to wrapper methods in object-oriented programming.
The syntax of a Continue statement is
continue commandName parameterList
where
commandName is the name of the current command.
parameterList is the list of parameters to be passed with the command. The list
must follow the same format as the parameter definitions in the handler
definition for the command. For handlers with labeled parameters, this means
that the parameter labels must match those in the handler definition. For
handlers with positional parameters, the parameters must appear in the correct
order. You can list actual values or parameter variables. If you list actual values,
those values replace the parameter values that were specified in the original
command. If you list parameter variables, the Continue statement passes the
parameter values that were specified in the original command.