• 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: Stopping a script in a Try Statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping a script in a Try Statement


  • Subject: Re: Stopping a script in a Try Statement
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 19 Apr 2001 22:24:59 -0700

On 4/19/01 8:17 PM, "Barton Chew" <email@hidden> wrote:

> I am writing a Start Up Items script that attempts to select a file on the
> desktop, renames the file and places it into a folder on the hard drive. If
> the file does not exist, I use a Try Statement to catch the error and exit
> the script.
>
> The problem is, I can not figure out how to stop the script. Is there a
> command for this?
>


return

(or, if you're in a handler, which would just put you back to the main
script,

error number -128

which cancels the script - but don't put it in the 'try' part, rather in the
'on error' part of the try/error block).

--
Paul Berkowitz


  • Follow-Ups:
    • Run script with parameters?
      • From: Harald E Brandt <email@hidden>
References: 
 >Stopping a scipt in a Try Statment (From: Barton Chew <email@hidden>)

  • Prev by Date: Re: problem running apple guidebook modules
  • Next by Date: open for access help
  • Previous by thread: Re: Stopping a scipt in a Try Statment
  • Next by thread: Run script with parameters?
  • Index(es):
    • Date
    • Thread