Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Clear Downloads Folder using AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Clear Downloads Folder using AppleScript
Authored by: Frederico on Apr 19, '11 10:29:01AM
I must be really bored today:

tell application "Finder" to move (every item of (container of item (path to me) as alias) whose name is not (name of item (path to me) as text)) to trash

Save the above single line as a compiled application and name it whatever you want; I suggest 'Clear This Folder' or 'Move Contents of This Folder to Trash'.

Be careful where you run it, because it will Trash everything in its directory.

I thought about using do shell script and rm, but this method allows the user to recover with a simple Command-Z (Undo Move).

[ Reply to This | # ]
Clear Downloads Folder using AppleScript
Authored by: leamanc on Apr 19, '11 05:03:51PM

Nice one! I like a simple one-liner, and will be employing this in my Downloads folder...which does get way overloaded with junk seemingly all the time.

[ Reply to This | # ]