The AppleScript comment syntax

AppleScript FAQ: How do I create comments in AppleScript?

Answer: There are two ways to create comments in AppleScript, and I show examples of both comment approaches in this article.

Back to top

AppleScript comments with "--" or "#" syntax

First, you can use the "--" syntax. This lets you create a comment like this at the beginning of a line:

-- my comment
display dialog "yada"

You can also use the same syntax to put a comment at the end of a line, like this:

display dialog "yada"  -- my comment

As mentioned in the Comments section below, you can also use the "#" character for comments, like this:

# this is a comment

You can use this '#' symbol just like you use the two dashed lines to create an AppleScript comment.

Back to top

Multiline AppleScript comments

You can also create multiline AppleScript comments like this:

-- comment 1
-- comment 2

or, using the preferred multiline AppleScript comment syntax form, like this:

(* Hello world, 
this is my first multi-line AppleScript
comment. *)
Back to top

Comments