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

AppleScript’s Rules for Naming Variables

Like other programming languages, AppleScript imposes a number of very specific rules on the naming of variables. AppleScript variable names cannot consist of language keywords such as tell, beep or if, then, else, and so on. In addition to these rules, you need to avoid using dictionary terms that are defined by the different applications that you may want to automate. Although AppleScript allows programmers to create very long and descriptive variable names, it does impose a 251 character limit. Though I cannot imagine a need to create a variable name greater than 251 characters, if you try to do so the Script Editor will display the error message shown in Figure 3.11.

Figure 3.11. Don’t let it be said ...

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