Re: Poking an Idle Handler
Re: Poking an Idle Handler
- Subject: Re: Poking an Idle Handler
- From: Brian Johnson <email@hidden>
- Date: Tue, 14 Sep 2004 20:05:09 -0700 (PDT)
On Wed, 15 Sep 2004, Mr Tea wrote:
This from Mr Tea - dated 14/9/04 3·18 pm:
tell application "Tea Timer"
tell (idle)
return
end tell
end tell
This from Brian Johnson - dated 14/9/04 4·53 pm:
or (assuming that Tea Timer has a "run" handler and that's what you want
it to move on to)
tell application "Tea Timer" to run
Implicit, but yes, the 'run' handler is there...
This particular little side project has a global variable called 'cups'
which is initially set to zero at the top of the script and increases in
value each time the code contained in the 'idle' handler runs. The value of
'cups' is checked on each run, and other variables are set accordingly. In
this case, therefore, telling the script to run would, I think, reset the
value of 'cups' to zero, which is not what's required.
Would it be different if I made 'cups' a property instead?
If there is some other action that the script performs (using handlers
other than run and idle), just tell the desired handler to run.
Alternatively, if all you want to do is trigger the idle event early,
you could
tell application "Tea Timer" to idle
This would increment 'cups' ahead of schedule, but wouldn't require you to
trigger the run handler at all. And, yes, if you made 'cups' a property,
property cups:0
it wouldn't (need to be) (re)initialized by the run handler before being
used in the idle handler (and elsewhere).
Brian Johnson, Dept of Architecture, University of Washington, Seattle
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden