Re: How do I simply quit execution?
Re: How do I simply quit execution?
- Subject: Re: How do I simply quit execution?
- From: Michelle Steiner <email@hidden>
- Date: Fri, 18 May 2001 13:34:41 -0700
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. |
----------------------------------------------------------------------