Language Guide
CHAPTER 2
Overview of AppleScript
28 Other Features and Language Elements
Identifiers whose first and last characters are vertical bars (|) can contain any
characters. For example, the following are legal identifiers:
|Back and Forth|
|Right*Now!|
Identifiers whose first and last characters are vertical bars can contain additional
vertical bars if the vertical bars are preceded by backslash (\) characters, as in
the identifier |This\|Or\|That|. A backslash character in an identifier must
be preceded by a backslash character, as in the identifier |/\\ Up \\/ Down|.
AppleScript identifiers are not case sensitive. For example, the variable
identifiers myvariable and MyVariable are equivalent.
Identifiers cannot be the same as any reserved words—that is, words in the
system dictionary or words in the dictionary of the application named in the
Tell statement. For example, you cannot create a variable whose identifier is
Yes within a Tell statement to the Scriptable Text Editor, because Yes is a
constant from the Scriptable Text Editor dictionary. In this case, AppleScript
returns a syntax error if you use Yes as a variable identifier.
Case Sensitivity 2
AppleScript is not case sensitive; when it interprets statements in a script, it
does not distinguish uppercase from lowercase letters. This is true for all
elements of the language.
The one exception to this rule is string comparisons. Normally, AppleScript
does not distinguish uppercase from lowercase letters when comparing strings,
but if you want AppleScript to consider case, you can use a special statement
called a Considering statement. For more information, see “Considering and
Ignoring Statements” on page 213.
Most of the examples in this chapter and throughout this guide are in lower-
case letters. Sometimes words are capitalized to improve readability. For
example, in the following variable assignment, the “N” in myName is capitalized
to make it easier to see that two words have been combined to form the name of
the variable.
set myName to "Pegi"