O'Reilly logo

Apple Pro Training Series: AppleScript 1-2-3 by Bill Cheeseman, Sal Soghoian

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

Lesson 10. Conditionals

The Simple if Test

The Two-Value if Test

The Multi-Value if Test

What’s Next?

You’ve learned a lot about the nuts and bolts of AppleScript, including how to store and manipulate data. But you haven’t yet learned much about how to make your scripts smart. You’ll take the first step toward writing intelligent scripts in this chapter.

What is the most important criterion of intelligence? We think it’s the ability to make decisions and to act on them. In AppleScript, the key to making decisions is the if statement and its variants. With an if statement, your script takes a quick look at the world around it, notices the current state of some condition it’s interested in, and responds appropriately based on what it sees. ...

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