Re: Halting a Script
Re: Halting a Script
- Subject: Re: Halting a Script
- From: Jon Pugh <email@hidden>
- Date: Tue, 24 Jun 2003 19:06:31 -0700
At 12:47 AM +0100 6/25/03, John Delacour wrote:
>
At 6:57 pm -0400 24/6/03, HomeLink USA wrote:
>
>
> I'm looking for a way to halt a script or go to the end of the script. Can a script "quit" itself?
>
>
if not 2 * 2 = 5 then
>
return
>
end if
>
beep
Another popular trick, when you are nested three routines deep, is to throw the user canceled error.
error number -128
You can throw some other error if you want to catch it farther up the chain. Like so:
on bail()
error number 99
end bail
on crunch()
bail()
end crunch
on munch()
crunch()
end munch
on run
try
munch()
on error m number 99
display dialog "Yummy"
end try
end run
Wheee!
Jon
_______________________________________________
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.