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

Re: Exit repeat on quit


  • Subject: Re: Exit repeat on quit
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 16 Apr 2002 13:20:17 -0700

As a matter of fact, it works great, and should on traditional Mac OS as well (modulo several bugs involving applets becoming unresponsive to clicks in the menu bar, all of which should be fixed in AppleScript 1.7.) For example...

property quitting : false

on run
repeat
-- real work here.
if quitting then exit repeat
end repeat
display dialog "All done!"
end run

on quit
set quitting to true
end quit


--Chris Nebel
AppleScript Engineering

On Tuesday, April 16, 2002, at 08:46 AM, Olivier Destrebecq wrote:

This is just wild speculation here. But did you try to have a quit handler set a global in your script and have your loop monitor this global to know when to quit.

I doubt that it might work, but who knows.

On Tuesday, April 16, 2002, at 05:10 AM, email@hidden wrote:

I want my script to quit even if it is in the middle of a long repeat
process. So how do I tell it to exit the repeat as soon as the user tells
it to quit?

I would wonder how the user will tell the script to quit if the script is
currently executing a repeat loop. Isn't the repeat loop hanging the
machine?

Emmanuel
_______________________________________________

Ahh, forgot to mention I use OS X 10.1.3 and AS 1.8.1. Even when the script is hard at work with a repeat loop the user can simply select Quit from the menu or Command-Q it. In pre-OS X systems I can imagine that a loop would lock up the application but not in OS X.

/pontus
_______________________________________________
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.

  • Follow-Ups:
    • Re: Exit repeat on quit
      • From: John W Baxter <email@hidden>
References: 
 >Re: Exit repeat on quit (From: Olivier Destrebecq <email@hidden>)

  • Prev by Date: ASP request...
  • Next by Date: Re: Preserve double quotes ?
  • Previous by thread: Re: Exit repeat on quit
  • Next by thread: Re: Exit repeat on quit
  • Index(es):
    • Date
    • Thread