O'Reilly logo

AppleScript® Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Taking Advantage of Constants

In addition to providing you with the ability to dynamically store and retrieve data stored in variables, AppleScript also lets you work with constants. A constant is a value that is known at development time and does not change. AppleScript provides programmers with access to a number of constants. For example, the mathematical value of pi can be referenced using the pi constant, as demonstrated here:

set x to 10 + pi

When executed, this example assigned a result of 13.14159265359 to a variable named x. AppleScript supports a number of different types of constants. Other examples of constants provided by AppleScript include the Boolean values of true and false and values representing both the days of the weeks and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required