Language Guide
CHAPTER 2
Overview of AppleScript
26 Other Features and Language Elements
Comments 2
To explain what a script does, you add comments. A comment is text that
remains in a script after compilation but is ignored by AppleScript when the
script is executed. There are two kinds of comments:
■ A block comment begins with the characters (* and ends with the
characters *). Block comments must be placed between other statements.
They cannot be embedded in simple statements.
■ An end-of-line comment begins with the characters -- and ends with the
end of the line.
You can nest comments, that is, comments can contain other comments.
Here are some sample comments:
--end-of-line comments extend to the end of the line;
(* Use block comments for comments that occupy
more than one line *)
copy result to theCount--stores the result in theCount
(* The following subroutine, findString, searches for a
string in a list of Scriptable Text Editor files *)
(* Here are examples of
--nested comments
(* another comment within a comment *)
*)
The following block comment causes an error because it is embedded in
a statement.
--the following block comment is illegal
tell application "Scriptable Text Editor"
get (* word 1 of *) paragraph 1 of front document
end tell