• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [AS] idle handler executes twice at the first time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >[AS] idle handler executes twice at the first time (From: Mátyás Ferenc Farkas <email@hidden>)

  • Prev by Date: Re: Scripting Additions 'Read' has stopped reaching EOF?
  • Next by Date: Re: Scripting Additions 'Read' has stopped reaching EOF?
  • Previous by thread: [AS] idle handler executes twice at the first time
  • Next by thread: Re: Filemaker 'whose' clause broken? (Modified by Chap Harrison)
  • Index(es):
    • Date
    • Thread