Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sazivad

macrumors 6502
Original poster
Jul 21, 2011
327
0
New Jersey
(Sorry if this is the wrong thread to be posting in, but I thought this might be useful.)

I made a quick AppleScript for clearing the Downloads folder and then emptying the Trash. I put it into a script here.

Here are the steps to have it run every login:
  1. Make sure to change "YOUR USERNAME" in the script to your actual username as it appears on you home folder.
  2. Go to File > Export and save the script as an application.
  3. Delete the original script.
  4. Put the application anywhere but the Downloads folder.
  5. Go to :apple: > System Preferences > Users & Groups > Login Items and add the application.
Let me know if it works, and if you have any feedback. :)
 
If there's interest in this sort of thing I have a script that will move files to the trash from ~/Downloads only if they're more than 90 days. It works with any user (no need to specify user name), won't delete recent stuff that you might want to see again, and let's you choose when to empty the trash.

Code:
tell application "Finder"
	set theFolder to folder "Downloads" in (path to home folder) as alias

	try
		delete (every item of theFolder whose modification date is less than ((get current date)) - 90 * days)
	end try
end tell

Of course this all assumes that you haven't renamed your downloads folder, but you probably haven't. Drop this into the Apple Script Editor and you should be good to go.
 
I've now made all the above links dead, and instead compiled them in an archive here, along with accompanying 'Read Me' s.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.