Quick Reference: Operators
Operators are mathematical and logical words and symbols you can use in an expression. The operators are each described in detail later in this section. For reference, they are listed here by category.
Mathematical Operators
Operator | Behavior |
---|---|
+, plus | addition |
\-, minus | subtraction |
\*, times, multiplied by | multiplication |
/, divided by | division |
^ | exponentiation (raise to a power) |
squared | raise to the second power |
to the power of | raise to the power specified |
cubed | raise to the third power |
%, percent | percent |
div | integer division |
rem | integer remainder |
modulo, mod | mathematical modulo |
is a multiple of, is divisible by | test for exact multiple of a number |
rounded to | round to a number of decimal places |
rounded to nearest | round to the nearest multiple of a value |
Comparison Operators
Logical Operators
Operator | Behavior |
---|---|
and | logical and |
and if | short-circuit logical and |
or | logical inclusive or |
or if | short-circuit logical inclusive or |
not | logical negation |
Text Operators
Operator | Behavior |
---|---|
& | text string concatenation |
&& | text concatenation with space inserted |
is in, is contained by, is not in, isn't in | one string contained in another, or value contained in a list |
contains, does not contain, doesn't contain | one string contains another, or value contained in a list |
is among, is not among, isn't among | one value is present among the chunks, items, keys or values of another |
begins with, does not begin with, doesn't begin with | one string begins with another, or list begins with a value or sublist |
ends with, does not end with, doesn't end with | one string ends with another, or list ends with a value or sublist |
Property List Operators
Operator | Behavior |
---|---|
adding | add properties from one property list to those from another |
replacing | add properties from one property list to those from another, overriding duplicates |
removing | remove specified properties from a property list |
retaining | remove properties from a property list, other than those specified |
Date Operators
Operator | Behavior |
---|---|
ago | time prior to now |
hence, from now | time later than now |
Miscellaneous Operators
Operator | Behavior |
---|---|
( ) | grouping |
is a | tests for types (number, integer, point, rect, date, logical, color) |
there is a | yields true if the specified object or file exists |
exists | yields true if the specified object or file exists |
is within | tests whether a point or rectangle is within a rectangle |
&&& | list concatenation |
joined by | converts a list or property list to text |
split by | converts text to a list or property list |
as | converts a value to a given internal representation |
(if ... then ... else ...) | selector expression |