O'Reilly logo

Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third Edition by Hanaan Rosenthal, Hamish Sanderson

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

Chapter 14. Making Decisions Using Conditionals and Loops

Previous chapters have explored in detail the first two key concepts behind AppleScript: how information is represented as objects, and the features used to manipulate those objects (commands, operators, and variables). However, there is one more key concept that you need to grasp before you can really use AppleScript effectively: how your script can make decisions on what to do and when to do it.

In AppleScript, the ability to make decisions is what gives your script "artificial intelligence." The AppleScript language provides three important features for making these decisions:

  • Conditional statements decide whether or not a section of code should be executed.

  • Repeat statements decide how ...

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