Language Guide
CHAPTER 8
Handlers
Subroutine Definitions and Calls 231
SYNTAX
subroutineName ¬
[ [ of | in ] directParameter ] ¬
[ [ subroutineParamLabel parameterValue ] ¬
| [ with labelForTrueParam [, labelForTrueParam ]... ¬
[ ( and | or | , ) labelForTrueParam ] ] ¬
| [ without labelForFalseParam [, labelForFalseParam ]...] ¬
[ ( and | or | , ) labelForFalseParam ] ] ¬
| [ given label:parameterValue ¬
[, label:parameterValue ]...] ]...
where
subroutineName (an identifier) is the name of the subroutine.
directParameter is the direct parameter, if one is included in the subroutine
definition. It can be any valid expression. As in application commands, the
direct parameter must be first if it is included at all.
subroutineParamLabel is one of the following labels used in the definition of
the subroutine: above, against, apart from, around, aside from, at,
below, beneath, beside, between, by, for, from, instead of, into, on,
onto, out of, over, thru (or through), under.
parameterValue is the value of a parameter, which can be any valid expression.
labelForTrueParam is the label for a Boolean parameter whose value is true.
You use this form in With clauses; because the value true is implied by the
word With, you provide only the label, not the value. (For an example of how
to use a With clause, see page 233.) If you use or or a comma instead of and
with the last parameter of a with clause, AppleScript changes the of or the
comma to and during compilation.
labelForFalseParam is the label for a Boolean parameter whose value is false.
You use this form in Without clauses; because the value false is implied
by the word Without, you provide only the label, not the value. If you use
or or a comma instead of and with the last parameter of a without clause,
AppleScript changes the or or the comma to and during compilation.
label is any parameter label used in the definition of the subroutine that is not
among the labels for subroutineParamLabel. You must use the special label
given to specify these parameters. (For an example, see “Examples” later in
this section.)