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 Loops to Perform Repetitive Actions

Another critical programming tool that is fundamental to the development of AppleScripts is the use of repetitive programming logic. AppleScript repetitive processing, commonly referred to as looping, relies on the repeat statement. A loop is a set of statements that are executed over and over again to process large amounts of data or to repeat a series of actions. For example, you might set up a loop to process the contents of a text file, starting at the beginning of the text file and processing each line until the last line is reached. Alternatively, you might set up a loop to control the execution of a computer game, repeatedly prompting the player for input and processing that input to produce some ...

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