Idle Interval 1.1

Getting Started
Idle Interval Scripting Addition

(1) Download the Try Block Utilities disk image and open the image file to mount it on the desktop.

(2) Use the Additioner (from the Try Block Utilities disk) to install the Idle Interval scripting addition into one of your scripting additions folders, or you can install it manually.

(3) Launch the Idle Interval Demo application and use the tool tips to learn the features. If you have started Remote Apple Events in the Sharing pane of System Preferences, you can try the Idle Interval Demo RC (Remote Control) to see how process flow control scripts can control the idle handler of a remote application.

Caution: To avoid a crash in Mac OS X, do not add your password to the keychain when using the Idle Interval Demo RC, or when running a sample remotely from Script Editor.

(4) Open your AppleScript Studio application project, and create a new idle handler, if it does not already have one.

(5) If you have not already done so, modify your idle handler to return zero explicitly, even if one of its statements causes an error (see the sample handler below). Returning zero from your idle handler signals AppleScript not to change the idle interval.

on idle theObject
     set newIdleInterval to 0 -- signal AppleScript not to change the idle interval

          -- ... normal idle handling statements...

          -- set newIdleInterval to ...  -- (optional) change idle interval

     on error errMsg number errNum
          -- (always catch errors to guarantee our return value)
          -- log {"idle handler error", errNum, errMsg}
     end try
     return newIdleInterval

end idle

Your idle handler is not required to return zero. It can return a positive number, and this will produce the same behavior with or without the Idle Interval scripting addition. However, when you change the idle interval this way, it uses the original AppleScript Studio implementation, which does not call your notification handler

(6) You are now ready to get and set the timing options properties of your application, as described by the Features page.

           <----- BACK: Introduction                                                      NEXT: Features ----->

Thursday, 07-Aug-2008 02:07:40 MST

© 2004-2007 Stuart B. Russell. All Rights Reserved.
Trademarked terms are the property of their respective owners.