Language Guide

Using Value Class Denitions 33
CHAPTER 3
Values 3
Figure 3-0
Listing 3-0
Table 3-0
Values are data that can be represented, stored, and manipulated in scripts.
AppleScript recognizes many types of values, including character strings, real
numbers, integers, lists, and dates. Values are different from application
objects, which can also be manipulated from AppleScript but are contained in
applications or their documents.
Each value belongs to a value class, which is a category of values that are
represented in the same way and respond to the same operators. To find out
how to represent a particular value, or which operators it responds to, check its
value class definition. AppleScript can coerce a value of one class into a value
of another. The possible coercions depend on the class of the original value.
This chapter describes how to interpret value class definitions, discusses the
common characteristics of all value classes, and presents definitions of the
value classes supported in AppleScript. It also describes how to coerce values.
Using Value Class Denitions 3
Value class definitions contain information about values that belong to a
particular class. All value classes fall into one of two categories: simple values,
such as integers and real numbers, which do not contain other values, or
composite values, such as lists and records, which do. Value class definitions
for composite values contain more types of information than definitions for
simple values.
Figure 3-1 shows the definition for the List value class, a composite value. The
figure shows seven types of information: examples, properties, elements,
operators, commands handled, reference forms, and coercions supported. The
sections following the figure explain each type of information. Some definitions
end with notes (not shown in Figure 3-1) that provide additional information.