• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: jc <email@hidden>
  • Date: Fri, 17 Nov 2000 13:19:04 -0800

I think that's the reverse of what jc was asking for, but it's on the right
track. Try...on error statements let you catch errors; what you do with them
after that is the interesting part. Steve's example will exit the loop cleanly
if any errors occur, but remaining items won't get processed. If you want to
ignore the error completely, don't do anything in the "on error" part, like

Hello,
The strange thing is, steve goodman's solution did exactly what I wanted it to do. It did not exit cleanly, instead, it resumed the loop and went on to the next item on the list.
I read and reread the AS Language Guide before coming to the list for help, and after Steve Goodman's suggestion, reread it again.
I came to the conclusion that Steve Goodman's solution was a creative interpretation of its function. I originally assumed that the on error statement would handle any errors and let the repeat loop go on to the next item on the list, but for some reason it doesn't work. The moment I added the "exit repeat" it worked.

here is a very truncated version of my script(only 2 list items instead of 100). perhaps there is something weird in this script that causes this phenomenon? i'm a newbie after all.
thanks,
joan

tell application "Finder"
set i to 1
set FilesToDelete to {file "file1" of folder "JcFolder" of startup disk, **
file "file2" of folder "JcFolder" of startup disk}
set FileCount to length of FilesToDelete
repeat with i from 1 to FileCount
try
delete item i in FilesToDelete
on error
exit repeat
end try
end repeat
end tell


  • Follow-Ups:
    • Re: (no subject)
      • From: jc <email@hidden>
References: 
 >RE: (no subject) (From: "Goodman, Steve" <email@hidden>)
 >Re: (no subject) (From: Chris Nebel <email@hidden>)

  • Prev by Date: [ANN] OSA Menu 1.2.3d2 TEST
  • Next by Date: OSA Menu
  • Previous by thread: Re: (no subject)
  • Next by thread: Re: (no subject)
  • Index(es):
    • Date
    • Thread