I have a stay open script with an idle handler which returns 60. i.e. It will
be run again in circa 60 seconds. The idle handler is initially called by the
run handler.
The run handler will be called many times and will, in turn, call the idle
handler many times. What happens in this situation?
Hi Simon!
There isn't really a need for the run handler to call the idle handler.
Idle events are generated by the system. If you want to control how long
you wait between them, or respond to being idle (e.g., by quitting), you
write an idle handler. Calling the idle hander does not make your script
idle.
So, if you have a script that is run by a folder action (for example), but
wants to do some house-keeping inbetween folder action events, just do
separate run and idle handlers.
btw, when a script launches, there is no good way to predict when the
first idle event will occur. It can even happen BEFORE the run event.