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
  • PrintPrint

The delay Command

The most basic form of time manipulation is adding a pause to a script by using the delay command from the Standard Additions scripting addition. This command is used to insert a pause of a specified duration into a script.

Enter and run Script 24.1. The first time you run it, there is a natural-feeling pause between the first sentence and the second. But the second time you run it, notice that the second statement executes immediately after the first. Depending on the voice used by the script, this might make the simulated conversation seem a bit forced and unnatural. The pause during the first run was an accidental result of AppleScript taking time to process the command. The conversation was more hurried on the second run because AppleScript remembered the processing that it had taken the time to perform the first time.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint