• 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: Forcing an applet to quit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing an applet to quit


  • Subject: Re: Forcing an applet to quit
  • From: Chris Nebel <email@hidden>
  • Date: Tue, 09 Jan 2001 20:46:11 -0800
  • Organization: Apple Computer, Inc.

Cal wrote:

> "Marc K. Myers" <email@hidden> wrote:
>
> > I tried this:
> >
> > on run
> > beep
> > doIt()
> > beep
> > end run
> >
> > on doIt()
> > error -128
> > end doIt
> >
> > as well as a bunch of other things in the handler that would make AS
> > unhappy ("set a to 1 / 0"). In each case, the script beeped twice. I
> > was surprised that it returned from the handler after the error. Is
> > there a way to halt execution in the handler itself?
>
> You forgot the word "number" in your "error" command:
>
> error number -128
>
> Without the word "number", you've basically told AppleScript to error with an
> Error Message String of "-128", instead of the error numbered -128.

...which means that Script Editor will report the error, and it beeps when it
does so. The second beep is coming from the error dialog, not your script.
"error number -128" will terminate the script silently.

--Chris Nebel
AppleScript Engineering


References: 
 >Re: Forcing an applet to quit (From: Cal <email@hidden>)

  • Prev by Date: Re: Downloading OS 9.1
  • Next by Date: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
  • Previous by thread: Re: Forcing an applet to quit
  • Next by thread: Re: Forcing an applet to quit
  • Index(es):
    • Date
    • Thread