O'Reilly logo

AppleScript® Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Compound Operators to Build Complex Conditional Logic

In addition to relational and arithmetic operators, AppleScript also provides programmers with access to a set of compound operators, which you can use in place of embedded if statements to develop complex conditional logic. Table 4.3 lists AppleScript’s compound operators and outlines their purposes.

Table 4.3. Compound Operators
OperatorDescription
andReturns a value of true only if both expressions return values of true.
orReturns a value of true if either expression returns a value of true.
notReverses or negates the value returned by an expression.

To see an example of how to use a compound operator, take a look at the following example.

set DateString to the current date set ToDay ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required