Language Guide

CHAPTER 3
Values
Value Class Denitions 49
OPERATORS
The Div operator always returns an integer as its result. The +, , *, Mod, and ^
operators return integers or real numbers.
The operators that can have integers as operands are +, -, *, (or /), Div, Mod,
^, =, , >, , <, and .
COERCIONS SUPPORTED
AppleScript supports coercion of an Integer value to a single-item list, a real
number, or a string.
You can also coerce an integer using the synonym Number, but the class of the
resulting value remains unchanged:
set x to 7 as number
class of x --result: integer
NOTES
The largest value that can be expressed as an integer in AppleScript is
536870909, which is equal to (2
29
– 3). Larger integers (positive or negative)
are converted to real numbers (expressed in exponential notation) when
scripts are compiled.
List 3
A value of class List is an ordered collection of values. The values contained in
a list are known as items. Each item can belong to any class.
LITERAL EXPRESSIONS
A list appears in a script as a series of expressions contained within braces and
separated by commas. For example,
{ "it's", 2, true }
is a list containing a string, an integer, and a Boolean.