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

Re: quit command


  • Subject: Re: quit command
  • From: Alex Zavatone <email@hidden>
  • Date: Tue, 10 May 2011 14:10:44 -0500

It's not a good idea to use Delay, since sometimes when it's compiled into an AS app or an OSX app ala xCode, it ends up monopolizing a processor.

On May 10, 2011, at 12:30 AM, Chris Page wrote:

On Apr 11, 2011, at 12:33 PM, louie wrote:

global x
set x to 0
tell application "TextEdit"
activate
end tell
on idle
set x to x + 1
if x ≥ 5 then
if application "TextEdit" is running then
say "working"
else
tell current application
quit
end tell
end if
set x to 0
end if
return 0.5
end idle
Any thoughts?

Why do you have x and why do you want idle to be called every 0.5 seconds, but only test if the application is running every 2.5 seconds?

How about simply:

tell application "TextEdit" to activate

repeat while application "TextEdit" is running
delay 2.5
say "working"
end repeat

If you save that as an application, it will automatically quit once it exits the repeat loop, so there's no need to explicitly "tell current application to quit".

-- 
Chris Page

 The other, other AppleScript Chris
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: quit command
      • From: Chris Page <email@hidden>
References: 
 >Re: quit command (From: Chris Page <email@hidden>)

  • Prev by Date: Re: quit command
  • Next by Date: Re: quit command
  • Previous by thread: Re: quit command
  • Next by thread: Re: quit command
  • Index(es):
    • Date
    • Thread