• 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: script to delete .html files from a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: script to delete .html files from a folder


  • Subject: Re: script to delete .html files from a folder
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 5 Nov 2004 10:09:25 -0700


On Nov 5, 2004, at 9:08 AM, Roger Donaghy wrote:

This script compiles without a problem, but when I run it, I get the following error:

Finder got an error: Can't get item 3 of folder "Macintosh HD:Users:rdonaghy:Documents:testScript:".

That's because by the time the script gets to item 3, there are fewer than 3 items left in the folder. In cases like this, you should remove from the end, working backwards.


Any help would be greatly appreciated.

Try this script instead:

set ThePath to (path to documents folder as string) & "testScript" as alias
tell application "Finder"
move (files of ThePath whose name extension is "html") to the trash
end tell


--
Help, I've caught a cult, and can't get out!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: script to delete .html files from a folder
      • From: Courtney Schwartz <email@hidden>
References: 
 >script to delete .html files from a folder (From: Roger Donaghy <email@hidden>)

  • Prev by Date: Re: script to delete .html files from a folder
  • Next by Date: Re: script to delete .html files from a folder
  • Previous by thread: Re: script to delete .html files from a folder
  • Next by thread: Re: script to delete .html files from a folder
  • Index(es):
    • Date
    • Thread