Language Guide
CHAPTER 7
Control Statements
192 If Statements
else --anything greater than 9
display dialog "You will need to file an extra form."
end if
The example shows how you can create a more complex Boolean expression
with the help of Boolean operators, such as the And operator. The expression
dependents < 9 and audit = false
has two Boolean expressions as operands (dependents < 9, audit =
false). If both expressions are true, the value of the entire expression is
true. Other Boolean operators are Or (another binary operator; if either
of its operands is true, the entire expression is true), and Not (a unary
operator; if its operand is true, the expression is false, and vice versa).
For more information about operators, see Chapter 6, “Expressions.”
If (Simple Statement) 7
A simple If statement contains one Boolean expression and a statement to be
executed if the value of the Boolean expression is true.
SYNTAX
if Boolean then statement
where
Boolean is an expression whose value is true or false.
statement is any AppleScript statement.
EXAMPLES
In the following If statement
if result > 3 then display dialog "The result is " &
result as string
the Display Dialog command is executed only if the value of the Boolean
expression result > 3 is true.