• 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
Finder - Delete empty folders, recursively
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Finder - Delete empty folders, recursively
      • From: Graff <email@hidden>
  • Prev by Date: [ANN] FastScripts 2.0
  • Next by Date: Re: [ANN] MathWallah beta testers please
  • Previous by thread: [ANN] FastScripts 2.0
  • Next by thread: Re: Finder - Delete empty folders, recursively
  • Index(es):
    • Date
    • Thread