Re: [AS] idle handler executes twice at the first time
Re: [AS] idle handler executes twice at the first time
- Subject: Re: [AS] idle handler executes twice at the first time
- From: Gary Lists <email@hidden>
- Date: Sun, 25 Jan 2004 22:16:20 -0500
Matyas Ferenc Farkas wrote [1/25/04 11:08 AM]:
>
hi,
>
>
i had to use an idle handler. but whatever return seconds i set up, at
>
the first execution the stay open app runs twice. i tried the default
>
30 seconds, the same result. i use 1.9.3. is it a bug of a feature? i
>
tried a lot of times, i even restarted my computer just in case, done
>
maintenance things, but none of them worked.
>
>
has somebody else the issues?
>
>
--
>
matyas
Matyas, szervusz.
I believe that your script will run twice, because there is likely an 'on
run' handler (implicit or explicit) or an 'on open' handler.
This handler executes when you do open or run the script, then the 'on idle'
handler when it's idle.
A workaround would be to add a property to the script, and then execute or
ignore some part of your script based on the state of that variable
property.
Example:
property |ranOnce?| : false
on run
set |ranOnce?| to true
...
end
on idle
if |ranOnce?| then
...
else
...
end if
Continue to set the property to whatever state you need in each handler.
Viszontla'ta'sra,
--
Gary
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.