Language Guide
CHAPTER 3
Values
Value Class Definitions 57
OPERATORS
The operators that can have records as operands are &, =, , Starts With, Ends
With, Contains, and Is Contained By.
For detailed explanations and examples of how AppleScript operators treat
records, see “Operators That Handle Operands of Various Classes,” which
begins on page 168.
COMMANDS HANDLED
You can count the properties in a record with the Count command. For
example, the value of the following statement is 2.
count of {name:"Sue", mileage:4000}
--result: 2
Another way to count the properties in a record is with a Length property
reference. For example, the value of the following reference is 3.
length of {name:"Sue", mileage:8000, city:"Sunnyvale"}
--result: 3
REFERENCE FORMS
The only reference form you can use with records is the Property reference
form. For example, the following reference specifies the Mileage property of
a record.
mileage of {name:"Sue", mileage:8000, city:"Sunnyvale"}
--result: 8000
You cannot refer to properties in records by numeric index. For example,
the following reference, which uses the Index reference form on a record,
is not valid.
item 2 of { name:"Sue", mileage:8000, city:"Sunnyvale" }
--result: not a valid reference
COERCIONS SUPPORTED
AppleScript supports coercion of records to lists; however, all property labels
are lost in the coercion and the resulting list cannot be coerced back to a record.