Language Guide
CHAPTER 4
Commands
Command Definitions 101
APPLESCRIPT COMMAND SYNTAX
[ get ] expression [ as className ]
APPLICATION COMMAND SYNTAX
[ get ] referenceToObject [ as className ]
PARAMETERS
expression An expression whose value is to be returned in the
result variable.
Class: Any AppleScript expression
className A class identifier that specifies the desired value class for
the returned data.
Class: Class
Default value: The default value class for the object or objects
referenceToObject
A reference to an object whose value is to be returned in the
result variable.
Class: Reference
RESULT
The result is the value of the specified reference or expression.
If the referenceToObject parameter specifies a single object only (such as word 1
or the last word), the result is a single value. If the specified object doesn’t
exist, for example, if the reference is word 12 and there are fewer than 12
words in the specified container, no result is returned.
If the referenceToObject parameter refers to more than one object (such as the
words whose first letter is "B"), the result is a list of values. The
first item in the list is the value of the first object specified, the second item is
the value of the second object specified, and so on. If the specified objects don’t
exist, for example, if the reference is the words whose first letter is
"B" and there are no words that begin with “B”, the result is an empty list.
Class: The class specified by the className parameter or a list of values of that
class. If the application cannot return data in the value class specified by the
className parameter, it returns a value or values of the default value class.