Automatically Clean Up Your Mac OS X Downloads (or Any) Folder
Whatsapp Pinterest

The Downloads folder is often one of the most cluttered and disorganised places to be. With new files appearing regularly and often ignored soon after, it quickly grows past a manageable size and becomes a maze of lost and forgotten files.

It’s best to keep your Downloads folder clean and organised, but it’s a dull and altogether too frequent task. It only makes sense to let your computer take a share of the burden and have it clean your Downloads folder automatically.

1. Smart Folders

Smart folders aren’t really folders at all (they are in fact saved searches), but you can use them as such. Instead of actually moving your files around, you can look at them through different windows, only viewing a specific subset of files that interests you. If you use smart folders to clean up your Downloads folder, you’re only doing so in a superficial sense. You’ll still have a cluttered folder somewhere, but the files you’re looking at seem structured.

Using smart folders in this way has both its advantages and disadvantages. It’s very easy to set up and — depending on your rules — allows some overlap between folders. On the downside, you’re not actually restructuring or interfacing with the original folder, just search results.

Additional Layer of Indirection

Note that creating a smart folder does not change the contents of the original. If you still want the Downloads folder to be your main point of access, you should first create a separate folder to store your downloaded files (e.g. a Downloads_Files folder). Next, change the default download location in the preferences of your browser to that folder. Doing this leaves you able to put aliases to your smart folders in your original Downloads folder.


If that seems like too much work, you can leave your setup as is, and put your smart folders somewhere else. You can access them from your sidebar, or create a separate folder for them (e.g. a Downloads_Smart folder, like in the screenshot above).

Creating a Smart Folder

Use Finder to navigate to the folder where your downloaded files are. Press cmd+alt+n or select File > New Smart Folder. This will put you in the familiar search window. Ensure you’ve selected the correct folder, because Finder has a tendency to revert to searching your entire computer (which is not what we want).


Tweak your search until you’ve narrowed down the results to your preference. You can search for keywords in the top right, or add more specific rules by clicking the little plus icon on the far right. Rules can be used to filter on a wide variety of attributes. Usually, you’ll filter on Kind, Date, Name or Contents, but you can select on all kinds of more specific metadata.


By default, all rules must be satisfied for a file to pass the filter. If you want to get more creative with rule combinations, hold the option (alt) key while adding a new rule. You’ll be able to specify whether any, all or none of a subset of rules must be satisfied.


Press Save when you’re finished. You can save the search to the default location and choose whether you want to add a shortcut to your sidebar. To add the smart folder to your regular folder structure, navigate to the saved search (if you used the default location, use Go > Go to Folder… > ~/Library/Saved Searches) and create an alias with Right-click > Make Alias.

2. Automator

If you’re looking for a solution with a bit more muscle, maybe Automator provides the solution. For those of you that don’t know Automator yet, it’s a drag-and-drop GUI tool for creating macros and applications 10 Automator Hacks You Can Create & Use Today [Mac] 10 Automator Hacks You Can Create & Use Today [Mac] Read More  that ships with Mac OS X. In contrast with Smart Folders, Automator doesn’t just present you with a cleaner view of your Downloads folder. You can use Automator to rename How To Use Automator To Batch Rename Images on Mac How To Use Automator To Batch Rename Images on Mac Read More , move, or even delete files that meet certain criteria.

Automatically Sort Files By Type

We’ll use Automator to automatically process files that are added to your Downloads folder. They’ll be sorted by type or extension, but the same process applies for sorting your files on other criteria.

Start by creating the folders you want to move your files to during sorting. I added several new folders to my Downloads folder: DocumentsArchivesPicturesVideo.


Fire up Automator and create a new Folder Action. For automatically cleaning up folders, Folder Actions are a godsend. These macros are linked with a single folder and triggered whenever new items are added to the folder.


Having created a new Folder Action project, you need to specify the folder it is attached to. Notice the drop down menu at the top of the screen and select the Downloads folder.


When new files are added to the specified folder, this Folder Action will be triggered. The files that were added are passed along to the workflow, so you can decide what to do with them. By chaining the right actions in our workflow, we’ll get Automator to behave exactly like we want to.

Drag the Set Value of Variable action from the Utilities category to the bottom of your workflow and give the variable a name. This allows us to pull the original input (the files that need to be sorted) back up at a later point in our workflow.


Add another Filter Finder Items action to the bottom of your workflow. This time, we’re selecting the files we’re interested in for one specific category. Say, all Documents. You can either filter by Kind, or for more precision, list the permitted file extensions (and allow files to pass if Any of the conditions are met).


To finish up, add the Move Finder Items action to the bottom of your workflow and indicate the associated category folder that you created at the start.


At this point, you’ve sorted files of one specific kind. Now, to sort the files for the other categories, we’re going to use the variable that we set earlier. Add the Get Value of Variable action to the bottom of your workflow and select the variable from before.


Now you can repeat the process of filtering and moving files like we did with the previous two actions. For each remaining category, just chain Get Value of VariableFilter Finder Items, and Get Value of Variable. That’s it! Press save and you’re done.

Application instead of Folder Action

Instead of using Folder Actions, you could create an Automator Application 3 Easy-To-Create Simple Automator Workflows for Everyday Use 3 Easy-To-Create Simple Automator Workflows for Everyday Use Read More . In contrast to Folder Actions, an Application isn’t triggered automatically when files are added to the folder, so you have to run it manually or schedule it to run periodically.


The Application isn’t triggered when new files are added to the folder, so before we do any file manipulation, we need to retrieve the files from your Downloads folder. We use a sequence of two Actions for this. From the Files & Folders category in the left sidebar, drag Get Specified Finder Items to the top of your workflow and add your Downloads folder to the folder list.


Again from the Files & Folders category, drag Get Folder Contents to the end of your workflow. It’s advised to leave the Repeat for each subfolder found option unchecked, because Automator won’t distinguish between file locations when it passes your files along.

First, we’ll make sure to define the exceptions: the files and folders we don’t want to sort. From the Files & Folders category in the application sidebar, find the Filter Finder Items action and drag it to the bottom of your workflow. Add a rule to weed out each of the category folders you previously created. Optionally, you can also choose to ignore files with a specific color label.


If you configured your workflow so it resembles the screenshot above, you’ll receive all files and folders located in the base level of your Downloads folder. Now, by chaining the right actions like before, we can get Automator to do what we want! For instance, you could follow the steps outlined in the previous step (starting with Set Value of Variable) and create an application that sorts your Downloads per category whenever you run it.

Only Reorganise When Too Large

If there aren’t too many files in your Downloads folder, a single unorganised directory can still give a clear overview. In fact, it may sometimes be preferred. A small adaptation to the workflow can make it so it only executes if your Downloads folder grows past a certain size. For instance, you can choose to leave your Downloads folder as is, but automatically reorganise it if there are more than 20 files in it.


Just above the first Filter Finder Items action, add a Run AppleScript action and paste in the following AppleScript code Learn to Automate Your Mac with AppleScript [Part 1: Introduction] Learn to Automate Your Mac with AppleScript [Part 1: Introduction] Read More :

on run {input, parameters}
tell application "System Events"
set numberOfFiles to (number of files in folder "~/Downloads")
end tell
if (numberOfFiles > 20) then
return input
end if
end run

This snippet checks the total number of files in your Downloads folder. If there are more than 20 files in it, it just passes its input along and your files are processed as before. Otherwise, it doesn’t pass anything to the next action in your workflow, leaving the subsequent actions nothing to work with. If you want, you can customise the script and change 20 to another value.

Scheduling an Application

Up until now, we’ve seen two ways to trigger a workflow. A Folder Action runs whenever new files are added to the Downloads folder and an Application that is triggered manually. There’s a third option, somewhere down the middle. You can use Mac’s Calendar application How To Instantly Add Anything To Your Mac's Calendar How To Instantly Add Anything To Your Mac's Calendar Add something to your Mac's calendar in just a few keystrokes – we've got the software to make it possible. Read More to trigger your Application periodically. For instance, you could clean your Downloads folder every day around midnight, or even at the end of a week.

Open the Calendar application and create a new calendar for your Automator applications using File > New Calendar. Creating a separate calendar is not strictly necessary, but it allows you to hide the events so your window doesn’t become cluttered.


Hold the plus icon and select your Automator calendar to create a new event. Give it an easily distinguishable name like ‘clean Downloads folder’ and press enter.


The event will be created on the current day, but we can still change that. Double-click on the event in your calendar to change the specifics. Change the date and hour to the time you first want your application to be triggered. Under repeat, choose the frequency at which you want your application to be scheduled to run.


Select alert > Custom > Open file and browse to the Application you created using Automator. In the bottom drop down menu, select At time of event to execute the application in sync with the event and confirm.


Now, every time one of these recurring Calendar events come to be, your application will be executed and your Downloads folder will be put in order. Finally, clear the checkbox next to the Automator calendar to hide these events from view.

That’s It!

We’ve shown you a few ways to keep your Downloads (or any folder on your Mac) clean and tidy, by hiding, sorting or even deleting items. You’re free to use your own rules or schedule – or simply run your Automator app every time you need it. We’d love to know how you make sure your Downloads remains manageable, so share your process in the comments below!

Explore more about: Computer Automation, Download Management.

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Fakir
    April 20, 2017 at 2:19 pm

    The scheduling doesn't seem to work, when the mac is shut down. Is there a way to boot the mac at a certain time too?

  2. Ara
    March 28, 2016 at 11:54 am


    I have a 2TB drive with millions of files on it. I just need the list of files with the following extensions ".fla", ".PSD" & ".tpl" in to a text or excel file.I tried to get the complete list of files, since the drive is too big, workflow its taking long to finish.

    Any ideas ?

  3. Thomas Martin
    January 19, 2016 at 1:56 am

    Question - my Automator folder action seems to fail when there is no item that matches the first filter. Example: [Set variable - New files] [Filter Finder Items - Any where Name begins with A] [Move to Folder A] [Get variable - New files] [Filter Finder Items - Any where Name begins with B] [Move to Folder B], etc.

    When I run this, if I dont have any items starting with the letter A, it never processes B. When I have both A and B, both process.

    Any suggestions?

    • cpt underpants
      July 15, 2016 at 9:58 pm

      Did you every get an answer for this? I noticed the same issue.

  4. Anonymous
    June 10, 2015 at 7:46 pm

    Ugh. Sorry. Was trying to comment on the "8 Smart Folders" story. After logging in I was taken here instead. Please delete my previous comment.

  5. Anonymous
    June 10, 2015 at 7:45 pm

    Excellent post! I already knew how to create basic Smart Folders (my documents modified today, yesterday, and this week, for example), but I learned at least as much as I knew already from reading.

    One question: In the "Find Apps You Haven’t Opened In A While" it seems you can only find apps you HAVE opened during a time period, not ones that haven't been opened within a given period. Is there something I'm missing?

  6. Peter Westerlund
    May 15, 2015 at 1:05 pm

    Is the Automator solution putting ALL the pictures into the Pictures folder? Even the pictures within a added folder? So the added folders will be losing it's pictures?

  7. dude
    February 12, 2015 at 11:28 pm

    Wasn't explained very clearly. Perhaps thinking as if someone does not know how to use OSX and they need help with something. The jargon used and vague descriptions did not provide any help what so ever. Thank you for trying. Better luck next time.

  8. Dann A
    June 11, 2014 at 6:44 am

    Super cool ideas! I'm always impressed by what can be done with Automator if you know what you're doing. I know a lot of people who should probably be taking advantage of this knowledge, and I will definitely be sharing it with them. :-)