A handy Downloads-folder-clearing app

Discussion in 'Mac Apps and Mac App Store' started by sazivad, Jul 28, 2012.

  1. sazivad macrumors 6502

    Joined:
    Jul 21, 2011
    Location:
    New Jersey
    #1
    (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. :)
     
  2. JacaByte macrumors 6502

    Joined:
    Dec 26, 2009
    #2
    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.
     
  3. sazivad, Jul 29, 2012
    Last edited: Jul 29, 2012

    sazivad thread starter macrumors 6502

    Joined:
    Jul 21, 2011
    Location:
    New Jersey
    #3
    Thanks for the feedback. I made a more advanced version of the script here.
     
  4. sazivad, Jul 29, 2012
    Last edited: Aug 12, 2012

    sazivad thread starter macrumors 6502

    Joined:
    Jul 21, 2011
    Location:
    New Jersey
    #4
    I've now made all the above links dead, and instead compiled them in an archive here, along with accompanying 'Read Me' s.
     

Share This Page