Finder - Delete empty folders, recursively
Finder - Delete empty folders, recursively
- Subject: Finder - Delete empty folders, recursively
- From: Paul Kampu <email@hidden>
- Date: Mon, 14 Jun 2004 14:42:59 -0400
Hello all!
Here is a script that very nicely deletes every file from every folder
within the parent, recursively. (don't know who wrote this script)
tell application "Finder"
set theRealFolder to (folder of the front window)
my dumpFiles(theRealFolder)
end tell
on dumpFiles(whatsPassed)
tell application "Finder"
delete every file of whatsPassed
set folderContents to (every item of whatsPassed)
repeat with anItem in folderContents
my dumpFiles(anItem)
end repeat
end tell
end dumpFiles
Now the question is...
Does anyone have some idea as to how to modify this script to delete the
EMPTY folders only? ie. Leave the folders containing files alone.
Or is it better to start from scratch? If so, any suggestions?
Thank you,
--
Paul
"An invincible determination can accomplish almost anything and in this
lies the great distinction between great men and little men."
Thomas Fuller
1608-1661, British Clergyman and Author
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.