Idle Interval Scripting Addition
The Idle Interval scripting addition enables you to develop more responsive AppleScript Studio applications. It gives you precise control of the idle interval, the time interval between invocations of your idle handler.
As an AppleScript Studio developer, you may have tried using an idle handler, and wished it had a more flexible scripting interface. Currently, the only way to set the idle interval is to return a new value from the idle handler. This can cause both inefficiency and inflexibility.
For example, if your idle handler returns 60, you can not change the idle interval for the next 60 seconds. To maintain efficiency without sacrificing responsiveness, your idle handler must return a compromise value, too short for some situations and too long for others.
Also, you can not get or set the idle interval from other handlers in your own script, or from other scripts outside your application. This limits the power and flexibility of process flow control scripts.
Also, you can not set the idle interval using fractions of seconds. Some applications would benefit with an idle interval less than one second, or between one and two seconds. Other applications may need irregularly but precisely scheduled, or event-driven, invocations.
The Idle Interval scripting addition solves these problems. It provides scriptable timing options for each AppleScript Studio application: reference interval, idle interval, idle frequency, next idle interval, next idle date, notification handler, and modify permission.
Look at all you can do with the Idle Interval scripting addition:
• Get and set the timing options any time, from any handler in your script, and even from scripts outside your application.
• Set the idle interval, idle frequency, and next idle interval using fractions of a second, or disable your idle handler indefinitely by setting the idle interval to zero.
• Schedule your idle handler as a one-shot timer, invoked once at an arbitrary date and time.
• Measure time intervals shorter than a second using the reference interval.
• Receive notification whenever anyone modifies the timing options.
• Restrict access to the timing options, so only you can change them.
• Load the scripting addition from inside your application, to ensure compatibility and to avoid modifying the host system.
NEXT: Getting Started ----->