B.3. Lists
This section summarizes properties of list object and element specifiers.
B.3.1. List Class Properties
The following table provides the properties for the list class.
Property | Meaning |
---|---|
length | The number of items in the list |
reverse | The list with its items in reverse order |
rest | Items 2 through the end of the list |
B.3.2. Element Specifiers
The following table summarizes the ways to specify items in a list.
Item Specifer | Meaning |
---|---|
first item, second item, third item, ..., tenth item | A specific item by number |
1st item, 2nd item, 3rd item, ... | A specific item by number |
item 1, item 2, item 3... | A specific item by number |
item −1, item −2, item −3 | An item relative to the last item; where −1 references the last item |
beginning | First item |
last item or end | Last item |
some item | A random item |
middle item | The middle item; item (n +1) div 2, where n is the size of the list |
every item | All items |
items | Same as everyitem |
items m through n
or items m thru n | Items m through n; can use beginning for m and end for n |
Get Beginning AppleScript® now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.