Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Making Decisions

Chapter 3. Making Decisions

You know how to write simple AppleScript programs to evaluate expressions, assign the results to variables, and display dialogs. Now you learn how to make decisions in your programs. Decision making is a fundamental characteristic of any programming language. AppleScript's relational and logical operators provide the means for asking questions, and the if statement and its variants enable you to alter the flow of execution based on the answers to those questions.

Predicting errors that can occur during a program's execution and taking preventive measures to handle them are two components of good programming discipline. The try statement, which allows you to catch errors that might otherwise cause your program to terminate, is also covered in this chapter.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial