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

Re: Finder - Delete empty folders, recursively


  • Subject: Re: Finder - Delete empty folders, recursively
  • From: Paul Kampu <email@hidden>
  • Date: Tue, 15 Jun 2004 12:08:13 -0400

On 6/14/04 8:56 PM, "Graff" <email@hidden> wrote:

> tell application "Finder"
> set theFolder to (folder of the front window)
> my ClearEmptyFolder(theFolder)
> end tell
>
> on ClearEmptyFolder(whatsPassed)
> tell application "Finder"
> set theFolders to folders of whatsPassed
> repeat with aFolder in theFolders
> my ClearEmptyFolder(aFolder)
> end repeat
> if ((count every item of whatsPassed) = 0) then
> -- display dialog "deleting " & name of whatsPassed
> delete whatsPassed
> end if
> end tell
> end ClearEmptyFolder

Ken, this works perfectly. Even on deeply nested folder sets! I'll keep an
eye on any strange behaviour. Thank you, very much!

Ronald, your solution worked most of the time. Don't know why but every so
often an empty folder would be missed. Not a big deal, though, better safe
than sorry. A great big THANK YOU to you as well!

All the best!
--
Paul
http://homepage.mac.com/pkampu/ (*not for the faint of heart*)

"No, TRY not. do or do not. There is no TRY." --Yoda(on error handling)
_______________________________________________
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.


References: 
 >Re: Finder - Delete empty folders, recursively (From: Graff <email@hidden>)

  • Prev by Date: Bailing out of a script
  • Next by Date: Re: recursion testing (was: Finder - Delete empty folders,
  • Previous by thread: Re: recursion testing (was: Finder - Delete empty folders, recursively)
  • Next by thread: BrainForest?
  • Index(es):
    • Date
    • Thread