AppleScript tip: how to use comments

By Alvin J. Alexander, devdaily.com

A common question from new AppleScript programmers is "How do I put comments in my AppleScript programs?" There are two ways to do this, and here are examples of both of those ways

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

Finally, you can also create multi-line comments like this:

-- comment 1
-- comment 2

or using the second comment syntax form, like this:

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

devdaily logo