Lesson 24. Adding Timing Controls to Scripts

The delay Command

The Idle Handler

The Easy Way: Use iCal

What’s Next?

There’s an old saying that “timing is everything.” Although this phrase is usually used when describing one’s life choices, it sometimes applies to AppleScript, too. Controlling the speed and timing of your scripts is essential when automating tasks that

• require a momentary pause, such as while a window opens or a Web page loads; or

• occur over a period of time or at specific times, such as a script that downloads your e-mail at 2 p.m. and 5 p.m. every day.

In this chapter, we’ll examine techniques and strategies for addressing time requirements in scripts.

The delay Command

The most basic form of time manipulation is adding ...

Get Apple Pro Training Series: AppleScript 1-2-3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.