Re: script to delete .html files from a folder
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