Expressions

    An expression is a series of terms that results in a value. There are several types of expressions:
    A literal expression is a value that is itself.
    Operations result in a new value using other values. To perform an operation, you use existing values and operators, such as the plus sign (+).
    open folder (3 +2) of startup disk
    The values of an operation can be other expressions or can be represented by a variable.
    Reference expressions refer to objects, which you can use to represent values.

Using operator constants

    An operation uses an operator to derive a value. AppleScript defines many constants that you can use as operators. Following are some of the operators you can use.

    Boolean operators:
    These operators result in a true or false value.
      Type   Constant    
    Binary logical and
    or

    Not (unary operator) not

    Equals =
    is
    equals
    is equal to

    Not equal is not
    is not equal to

    Greater than >
    [is] greater than
    comes after

    Less than <
    [is] less than
    comes before

    Greater than or equal to >=
    is greater than or equal to
    does not come before

    Less than or equal to <=
    is less than or equal to
    does not come after

    Starts with starts with
    begins with

    Ends with ends with

    Contains contains

    Does not contain does not contain

    Is contained by is in
    is contained by

    Is not contained by is not in
    is not contained by

    Miscellaneous operators:
      Type   Constant   Description
    Concatenation & Joins values. Results in a List, Record, or String.

    Coercion as Converts a value to another class.

    A Reference To a reference to Assigns a reference to an object as the value of a variable.

    Mathematical operators:
    Use these operators with integers, real numbers, and dates.
      Type   Constant    
    Addition +

    Subtraction -

    Division ÷
    /

    Integral division div

    Remainder mod

    Exponent ^

 


Table of contents