After extended usage, the Downloads folder on a Mac quickly turns into a labyrinth with numerous downloaded files, some of which may be unused. In essence, this occupies a significant portion of the hard drive space.
In this article, Mytour will instruct you on how to automatically delete files from the Downloads folder on Mac.
Automated deletion of files in the Downloads folder on Mac
Method 1: Setting up Smart Folders
Smart Folders are not your typical folders; they are used to store searches. With this feature, instead of having to navigate through files in the Downloads folder, users can filter to view a specific subset containing files of interest.
Using Smart Folders in this way has both advantages and disadvantages. The advantage is the ease of setting up folders, and depending on user rules, it can allow for duplicate content.
In addition, the drawback is that creating a Smart Folder doesn't alter the original contents, meaning files in the Downloads folder aren't completely deleted or rearranged.
How to Create a Smart Folder
Firstly, open the Finder folder, which contains the files you've downloaded.
Next, click on File =>New Smart Folder. On the screen, you'll see the familiar Finder search window. In the toolbar below, under the Search section, select Downloads instead of This Mac.
Utilize available search filters to narrow down the types of downloaded files you're looking for. You can input search keywords into the Search box on the toolbar or add specific rules by clicking the small plus icon in the top right corner.
You can combine various file attributes, such as file type, creation date, name, and file content, to search more accurately.
By default, a Finder item must meet all the listed rules. If you want to combine rules, simply press and hold the Option key
Once the filters are set up, click on the Save button in the top right corner to save the changes. Optionally, you can save the Smart Folder to the default location (-/Library/Saved Searches) and add a shortcut to the sidebar.
To group all Smart Folders together, the ideal solution is to use their aliases instead of the original folders. Aliases act as shortcuts, reducing clutter in Finder. Simply select the Make Alias option from the right-click menu to create an alias for the Smart Folder.
Finally, you can save the Smart Folder alias to a dedicated folder, the Downloads folder, or add a shortcut to the sidebar.
Method 2: Creating Folder Actions with Automator
For those seeking a useful and simpler solution, Automator can be very helpful in this case. With a user-friendly graphical interface that includes drag-and-drop tools, users can easily create macros and applications.
In contrast to Smart Folders, Automator not only provides users with a deep insight into the Downloads folder on Mac, but also supports automatic deletion of 'standard' files, and even renaming / moving these files.
Follow the steps below to automatically delete files in the Downloads folder on Mac. We will use file type as a filter, apply a similar process to organize files but based on different criteria.
First, activate Automator, click on New Document, choose Folder Action as the document type. This type of macro works with a single folder and is triggered whenever new items appear in the folder.
The folder in question here is the Downloads folder. Select Downloads from the menu in the right pane of the Automator window.
Next, drag the Set Value of Variable action from the middle pane into the workflow below the menu. From the Variable list below, set the Variable to new files.
Adding the next actions
The next step is to add the second action to the workflow. Drag the Filter Finder Items from the middle pane into the empty space below the first action. Here you can specify the types of files you're interested in and fine-tune the filters accordingly.
In this example, Mytour selects document files such as text files or PDFs. The filters are now set as shown below:
To add any additional filters, simply click on the + button available within the action.
Finally, all you need to do is 'move' the downloaded text files to the trash. To do this, simply drag and drop the Move Finder Items to Trash action.
Next, click on File =>Save to save the Folder Action and have it run automatically whenever new files appear in the Downloads folder.
Method 3: Installing Hazel Application
If you prefer not to use solutions like Smart Folder or rely on Automator assistance, the ultimate solution for you is to utilize the Hazel application. Hazel automates search operations and deletes downloaded files in the Downloads folder.
Additionally, the application includes a set of rules to clean up the Downloads folder. All you need to do is check the boxes next to the rules you want to activate. For example, if you check Movies to automatically send video files to the Movies folder.
- Download Hazel for Mac and install it here.
If desired, you can also edit existing rules and add new ones. For instance, if you want to edit the Movies rule above to upload movie files to a server and then delete them from the Downloads folder instead of moving them to the default folder, first click on the pencil icon at the bottom corner of the rules list to display the original rules.
A pop-up window will now appear on the screen, where you can customize the actions as follows:
1. Select the Upload option from the menu, then add detailed server information.
2. Add a second action by clicking on the + button next to the first action. For this action, choose Move from the first menu and Trash from the second menu.
Click OK to save the changes.
Note: Duplicate or corrupted files in the Downloads folder will also be automatically deleted.
To create new rules for other folders, simply add the folder to the left pane, then add, delete, or edit rules for these folders in the right pane.
The above article from Mytour just guided you through 3 ways to automatically delete files in the Downloads folder on Mac. Additionally, if you have any questions or need clarification, readers can leave their comments below the article.
You can learn about setting up automatic file deletion in the Download folder on Windows 10 to remove unused files by checking out our guide on automatically deleting files in the Download folder on Windows 10 on our website.