Language Guide
CHAPTER 2
Overview of AppleScript
Other Features and Language Elements 25
Continuation Characters 2
A simple AppleScript statement must normally be on a single line. If a statement
is longer than will fit on one line, you can extend it by including a continuation
character, ¬ (Option-L or Option-Return), at the end of one line and continuing
the statement on the next. For example, the statement
delete word 1 of paragraph 3 of document "Learning AppleScript"
can appear on two lines:
delete word 1 of paragraph 3 of document ¬
"Learning AppleScript"
The only place a continuation character does not work is within a string. For
example, the following statement causes an error, because AppleScript interprets
the two lines as separate statements.
--this statement causes an error:
delete word 1 of paragraph 3 of document "Fundamentals ¬
of Programming"
Note
The characters -- in the example indicate that the first line
is a comment. A comment is text that is ignored by
AppleScript when a script is run. Comments are added to
help you understand scripts. They are explained in the
next section, “Comments.” ◆
If a string extends beyond the end of the line, you can continue typing without
pressing Return (the text never wraps to the next line), or you can break the
string into two or more strings and use the concatenation operator (&) to
join them:
delete word 1 of paragraph 3 of document "Fundamentals " ¬
& "of Programming"
For more information about the concatenation operator, see Chapter 6,
“Expressions.”