Language Guide

CHAPTER 3
Values
56 Value Class Denitions
LITERAL EXPRESSIONS
Records appear in scripts as series of properties contained within braces and
separated by commas. Each property has a label. Following the label is a colon,
and following the colon, the value of the property. For example, the record
{ name:"Mitchell", height:70.5, weight:165 }
contains three properties: Name (a string), Height (a real number), and Weight
(an integer). The values assigned to properties can belong to any class.
AppleScript evaluates expressions in a record before using the record in other
expressions. For example, the record
{ name:"Mitchell", height:72 - 1.5, weight:150 + 15 }
is equivalent to
{ name:"Mitchell", height:70.5, weight:165 }
PROPERTIES
In addition to the properties that are specific to each record, two properties are
common to all records:
Class The class identifier for the object. For most records, the value of
the Class property is record. However, the Class property of a
record is not read-only. AppleScript and applications use special
records for certain data. For example, the Scriptable Text Editor
uses special records to specify the styles (such as bold and
underline) of text objects. The value of the Class property for
these records is the class identifier Text Style Info, as illustrated
in this example:
{class:Text Style Info, On Styles:{Bold}, ¬
Off Styles:{ Italic, Outline, Shadow}}
Length An integer containing the number of properties in the record.
This property is read-only.
If you define a Class property explicitly in a record, the value you define
replaces the implicit Class property record described above.