Chapter 6. Variables and Constants

This chapter describes the rules for AppleScript variables, including variable scope and the special variables that you can add to your script called properties. The second part of this chapter is devoted to AppleScript’s predefined variables such as pi and current application (a constant). These AppleScript variables are called constants because their value is predefined, and you mostly cannot use the same words for your own script variables. You could name one of your own variables pi (a predefined variable) and get away with it, but this would only confuse the readers of your code.

Get AppleScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.