• 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: Timed loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Timed loop


  • Subject: Re: Timed loop
  • From: Ed Stockly <email@hidden>
  • Date: Thu, 22 Nov 2007 09:53:05 -0800


set jetzt to current date

set dann to jetzt + 10 * minutes

repeat until (current date) >= dann

    delay 10 -- do your work here. I chose a delay because I have 

nothing to do

end repeat


That loop could be replaced with a single line:

delay 600

So, if there is nothing to do inside your loop, you don't need to loop at all.

However, if there is work to be done within your loop then I'd try something like this:

repeat 60 times
--do some stuff
delay 10
end repeat

I prefer not making multiple calls to OSAX when not needed, and getting the current date multiple times is not needed here.


HTH
ES
=
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Timed loop
      • From: Peter Baxter <email@hidden>
    • Re: Timed loop
      • From: Doug McNutt <email@hidden>
  • Prev by Date: Re: generating scripts
  • Next by Date: Re: Timed loop
  • Previous by thread: Re: Timed loop
  • Next by thread: Re: Timed loop
  • Index(es):
    • Date
    • Thread