Allowed coercions
Syntaxset theVar to pi (*theVar is set to the value of the pi constant, which is about 3.14159265359 *) DescriptionAppleScript and scriptable applications include several constants or pre-defined variables that are based on the constant class. Chapter 6 includes more information on these constants. Examplescase is a constant that in the following example will determine how strings are compared: considering case set compString to ("I am" is equal to "i am") end considering This code sets the variable compString to false because the two strings are not equal considering the case of the string characters. The AppleScript constant case, if you test it using the code class of case, returns the constant class. Many applications have defined their own constants using the constant value type. For example, Sherlock 2's current tab property will return one of the following Sherlock 2-defined constants (Find File Tab, Find by Content Tab, or Search Internet Tab): tell application "Sherlock 2" set sh_tab to (get current tab) class of sh_tab -- returns constant end tell |