Language Guide

CHAPTER 2
Overview of AppleScript
Expressions 21
Values are an important means of exchanging data in AppleScript. When you
request information about application objects, it is usually returned in the form
of values. Similarly, when you provide information with commands, you
typically supply it in the form of values.
A fixed number of specific types of values are recognized by AppleScript. You
cannot define additional types of values, nor can you change the way values
are represented. The different types of AppleScript values, called value classes,
are described in Chapter 3, “Values.”
Expressions 2
An expression is a series of AppleScript words that corresponds to a value.
Expressions are used in scripts to represent or derive values. When you run a
script, AppleScript converts its expressions into values. This process is known
as evaluation.
Two common types of expressions are operations and variables. An operation
is an expression that derives a new value from one or two other values. A
variable is a named container in which a value is stored. The following sections
introduce operations and variables. For more information about these and
other types of expressions, see Chapter 6, “Expressions.”
Operations 2
The following are examples of AppleScript operations and their values. The
value of each operation is listed following the comment characters (--).
3 + 4 --value: 7
(12 > 4) AND (12 = 4) --value: false
Each operation contains an operator. The plus sign (+) in the first expression, as
well as the greater than symbol (>), the equal symbol (=) symbol, and the word
AND in the second expression, are operators. Operators transform values or
pairs of values into other values. Operators that operate on two values are
called binary operators. Operators that operate on a single value are known as
unary operators. Chapter 6, “Expressions,” contains a complete list of the
operators AppleScript supports and the rules for using them.