Home
The HyperCard Center
Search
Help Extras

Home » Help Extras » Helpful Tips » Operator precedence in AppleScript

Operator precedence in AppleScript

Each operator in AppleScript has an order of precedence. Use the chart below as a guide. AppleScript evaluates operators with lower order numbers before those with higher order numbers. Operators with the same order number are evaluated in an expression from left to right.

Order Operators
1 ()
2 - [minus sign]
+ [plus sign]
3 ^
4 * / ÷ div mod
5 + - [addition & subtraction]
6 as
7 < > <= >= ≤ ≥
8 = ≠
9 not
10 and
11 or

Use parentheses to eliminate ambiguity in the process of evaluation—parentheses have the highest order of precedence: (3+2) * 5 = 25. If you use parentheses, AppleScript evaluates the innermost parenthetical expression first.

« Operator precedence | Helpful Tips | Power keys for Paint tools »

Version 0.8b4 (July 4, 2025)

Made with Macintosh

Sitemap | Switch to Retro View