• 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 scipt in a Try Statment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping a scipt in a Try Statment


  • Subject: Re: Stopping a scipt in a Try Statment
  • From: "Marc K. Myers" <email@hidden>
  • Date: Fri, 20 Apr 2001 10:36:06 -0400
  • Organization: [very little]

> Date: Thu, 19 Apr 2001 23:17:05 -0400
> Subject: Stopping a scipt in a Try Statment
> From: Barton Chew <email@hidden>
> To: <email@hidden>
>
> 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?

Use the "return" command:

set theVar to "George"
try
set theDate to date theVar
on error
display dialog "Oops!"
return
end try
display dialog "I made it!"

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[4/20/01 10:35:43 AM]


  • Prev by Date: Re: Simultaneous Events (in AS CGI's)
  • Next by Date: scripting the finder
  • Previous by thread: Re: Stopping a scipt in a Try Statment
  • Next by thread: Re: Stopping a scipt in a Try Statment
  • Index(es):
    • Date
    • Thread