Language Guide

CHAPTER 6
Expressions
Operations 163
Table 6-1 AppleScript operators
Operator Description
and And. Binary logical operator that results in true if both
the operand to its left and the operand to its right are
true. Both of the operands must evaluate to Boolean
values. When evaluating expressions containing the And
operator, AppleScript checks the leftmost operand first.
If its value is false, AppleScript does not evaluate
the rightmost operand, because it already knows the
expression is false. (This behavior is sometimes called
short-circuiting.)
Class of operands: Boolean
Class of result: Boolean
or Or. Binary logical operator that results in true if either
the operand to its left or the operand to its right is true.
At least one of the operands must evaluate to a Boolean
value. When evaluating expressions containing the Or
operator, AppleScript checks the leftmost operand first.
If its value is true, AppleScript does not evaluate the
rightmost operand, because it already knows the
expression is true. (This behavior is sometimes called
short-circuiting.)
Class of operands: Boolean
Class of result: Boolean
& Concatenation. Binary operator that joins two values. If
the operand to the left of the operator is a string, the
result is a string. If the operand to the left of the operator
is a record, the result is a record. If the operand to the left
of the operator belongs to any other class, the result is
a list.
Class of operands: Boolean, Class Identifier, Constant,
Data, Date, Integer, List, Real, Record, Reference, String
Class of result: List, Record, String
=
is
equal
equals
[is] equal to
Equal. Binary comparison operator that results in true if
the operand to its left and the operand to its right have
the same value. The operands can be of any class. The
method AppleScript uses to determine equality depends
on the class of the operands.
Class of operands: Boolean, Class Identifier, Constant,
Data, Date, Integer, List, Real, Record, Reference, String
Class of result: Boolean
continued