Wednesday, 6 March 2019

3 Ways to Automatically Delete Downloads on Mac

The Downloads folder on your Mac quickly turns into a maze of lost and forgotten files. It needs clean up and organization to keep it manageable.

The good news is that you don’t have to deal with these dull, routine tasks yourself. Let your computer take over for you. You can make your Mac clean your Downloads folder (or any other folder) automatically with the following methods.

1. Set Up Smart Folders

sample smart folder in Finder on Mac

Smart folders aren’t folders at all—they’re saved searches, to be precise—but you can use them as such. With this feature, instead of moving around the files in the Downloads folder, you can filter them to view a specific subset that interests you.

Using smart folders in this manner has both its advantages and disadvantages. The folders are easy to set up, and depending on your rules, allow some overlap between their contents.

On the downside, you’re not actually deleting files or restructuring the Downloads folder. It only seems like you are, meaning the folder stays cluttered under the hood. To be clear, creating a smart folder does not change the contents of the original.

How to Create a Smart Folder

To begin, open the Finder folder where your downloaded files are. (This will be the Downloads folder if you haven’t messed with the system defaults.)

Next, click on File > New Smart Folder. You’ll then see the familiar Finder search window. In the section below the toolbar, confirm that the search folder is set to Downloads and not This Mac. (Finder tends to revert to searching your entire computer, which is not what you want here.)

Use the search filters available to narrow down the type of downloaded files you’re looking for. You can search for keywords using the search box in the toolbar, or add more specific rules by clicking the little plus icon on the far right.

Feel free to combine multiple file attributes such as Kind, Created date, Name, and Contents to get more specific with your search.

Creating a smart folder in Finder on Mac

By default, a Finder item must meet all the listed rules to pass the filter. If you want to get more creative with rule combinations, hold down the Option key while adding a new rule. Finder then lets you specify whether any, all, or none of a subset of rules must be met.

Hit the Save button at the top-right below the toolbar after you’ve set up the filters to your satisfaction. You can save the smart folder to the default location (~/Library/Saved Searches) and choose whether you want to add a shortcut to your sidebar.

Saving a smart folder in Finder on Mac

To group all your smart folders together, it’s best to use their aliases instead of the original folders. Aliases are shortcuts that help reduce Finder clutter. You can make one for a smart folder using the Make Alias option in its context menu or right-click menu.

It’s up to you whether you want to save the smart folder aliases to a dedicated folder, the Downloads folder itself, or add sidebar shortcuts to them.

2. Create a Folder Action With Automator

If you’re looking for a solution with a bit more muscle, Automator can help. It’s a drag-and-drop GUI tool that ships with macOS and lets you create macros and applications. We’ve looked at some basic uses for Automator before if you’re a newcomer.

In contrast with Smart Folders, Automator doesn’t just present you with a cleaner view of your Downloads folder. It also helps you automatically delete files that meet certain criteria, or even rename/move them.

Let’s use Automator to auto-delete files that get added to your Downloads folder. We’ll use the file type as our filter, but the same process applies for sorting your files based on other criteria.

First, fire up Automator, click on New Document, and select Folder Action as your document type. This type of macro works with a single folder and gets triggered whenever new items show up in the folder.

the default three-pane view in Automator on Mac

The folder in question here is Downloads. Select it from the dropdown menu in the right-hand pane in the default three-pane view of Automator.

Then, drag the action Set Value of Variable from the middle pane to the blank workflow section below the dropdown menu. From the Variable list below this section, rename the variable to, say, new files, for convenience.

Further Workflow Actions

Now it’s time to add a second action to the workflow. Drag Filter Finder Items from the middle pane to the space below the first action. Here, you can specify the types of files you’re interested in and tweak the filters accordingly.

Let’s go for documents that are either text files or PDFs. Our filters will then look like they do in the screenshot below. You can add other filters using any of the + buttons available within the action.

Add Filter Finder Items action to workflow in Automator on Mac

Now, all that’s left to do is send the filtered downloads to the trash. To do this, drag the Move Finder Items to Trash action to the workflow section. This action doesn’t receive any special parameters. You can go ahead and click on File > Save to save the folder action and have it run automatically whenever new files show up in the Downloads folder.

3. Install Hazel

sample automation rule in Hazel on Mac

If you don’t want a superficial cleaning solution like smart folders and you’d rather not fiddle with Automator, give Hazel a try. It’s an automation app for macOS and it can fetch you the same results as the two methods above, while being much more user-friendly.

Hazel even has a sample rule to clean the Downloads folder. All you have to do is select the checkboxes that go with the rules you want to activate. For example, you can select the Movies checkbox to send video files to the Movies folder automatically.

You can edit the existing rules and add more of your own. To show you how that’s done, say you want to edit the Movies rule above to upload movie files to a server and then delete them from Downloads instead of moving them to the default folder. You’ll first have to click on the pencil icon below the rules list to reveal the original rule.

In the popup that appears, leave the trigger action untouched, but tweak the follow-up actions:

  1. Select the Upload option from the dropdown menu and then add the necessary server details to go with it.
  2. Add a second action using the + button available next to the first one. For this action, select Move from the first dropdown menu and Trash from the second menu.

Click on the OK button to seal your choice.

edit sample rule in Hazel on Mac

(The Downloads automation also lets you discard duplicate files and incomplete downloads automatically.)

Creating new rules for other folders is also easy. Begin by adding the folder in question to the left-hand pane and you can then add, remove, and edit rules for this folder from the right-hand pane.

Download: Hazel ($32, trial version available)

Let Your Mac Do the Work

As we saw above, you can not only keep your Downloads folder clean and tidy effortlessly, but also manage other folders across your Mac.

If this has got you in a mood to clean up, don’t stop now. Why not clean up your Mac desktop next?

Read the full article: 3 Ways to Automatically Delete Downloads on Mac



from MakeUseOf https://ift.tt/2TA2pVW
via IFTTT

No comments:

Post a Comment