• 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: How do I simply quit execution?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I simply quit execution?


  • Subject: Re: How do I simply quit execution?
  • From: Jeffrey W Baumann <email@hidden>
  • Date: Sat, 19 May 2001 11:25:14 -0500

How about

tell me to quit

?

Jeffrey W Baumann
email@hidden
www.linkedresources.com

On Friday, May 18, 2001, at 03:34 PM, Michelle Steiner wrote:

On 5/18/01 9:42 AM, Matthew Broms <email@hidden> wrote:

This seems like such an easy problem, but for some reason I cannot figure
out how to quit my script. If I'm nested down several handlers and an error
gets thrown or the user clicks on a "Cancel" dialog, I just want the script
to stop completely, as if it finished. How can I just abort the whole
execution?

Normally, if a user clicks a Cancel button, the script will stop
executing immediately. If it doesn't, a variation on what's below should
work.

I've tried quit (tell process "myScript" to quit), exit, cancel, return,
abort, kill, die verman! - nothing works. The best I can do is an exit
repeat (if I'm in a loop) which just puts me back up a handler. I don't
want to do this all the way up, but if I don't, an error gets thrown because
the data that handler was trying to supply didn't supply it. So the user is
presented a cryptic error dialog box.

Wrap the code in a try statement like this:

try
code
on error
error number -128
end

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------
_______________________________________________
applescript-users mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/applescript-users


References: 
 >Re: How do I simply quit execution? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: help needed-- probably a scoping problem
  • Next by Date: Re: AS and SSI
  • Previous by thread: Re: How do I simply quit execution?
  • Next by thread: multiple internal ports
  • Index(es):
    • Date
    • Thread