Language Guide

CHAPTER 3
Values
36 Using Value Class Denitions
REFERENCE FORMS
Use the following forms to refer to properties of lists and items in lists:
You can count the items in a list with the Count command. For example,
the value of the following statement is 6.
count {"a", "b", "c", 1, 2, 3}
--result: 6
You can also count elements of a specific class in a list. For example, the
value of the following statement is 3.
count integers in {"a", "b", "c", 1, 2, 3}
--result: 3
Another way to count the items in a list is with a Length property
reference:
length of {"a", "b", "c", 1, 2, 3}
--result: 6
Property. For example, class of {"this", "is", "a", "list"}
specifies list.
Index. For example, item 3 of {"this", "is", "a", "list"}
specifies "a".
COMMANDS HANDLED
AppleScript supports coercion of a single-item list to any value class
to which the item can be coerced if it is not part of a list.
AppleScript also supports coercion of an entire list to a string if all
items in the list can be coerced to a string. The resulting string
concatenates all the items:
{5, "George", 11.43, "Bill"} as string
--result: "5George11.43Bill"
COERCIONS SUPPORTED