Language Guide
CHAPTER 6
Expressions
156 Script Properties
Predefined Variables 6
Predefined variables are variables whose values are supplied by AppleScript.
You can use them in scripts without setting their values. Predefined variables
are global—that is, you can use them anywhere in a script.
For a summary of the predefined variables in the AppleScript English language
dialect, refer to Appendix A, “The Language at a Glance.”
Note
Although AppleScript does not prevent you from setting
the values of predefined variables, you should treat
predefined variables as constants—that is, you should
never change their values. ◆
Script Properties 6
Script properties are labeled containers for values that you can use in much the
same way you use variables. The value of a script property persists until you
recompile the script that contains it, and you can easily set the property’s initial
value without resetting it each time the script is run. You can accomplish the
same thing with a global variable, but it is usually more convenient to use a
property for this purpose.
This section describes how to define script properties.
Note
The description of script properties in this section assumes
that you are using the Script Editor application supplied
with AppleScript. Other script editors might not support
persistence of script properties. If you are using a different
script editor, check its documentation to see how it handles
script properties. ◆