Doing this manually can be a tedious task.

Thankfully, there’s a way to automate it.

Let’s show you how.

Choosing document type in Automator app on a Mac.

Automator supports multiple types of tasks.

Look for a dropdown box in the rightmost pane at the top of the screen.

It’ll appear next to the text “Folder Action receives files and folders added to.”

Choosing a folder to perform action on in Automator app.

hit it and select “Other.”

Then, pick the “Downloads” folder in the Finder and hit “Choose.”

hit the search box in the middle pane and look for “Run Shell Script.”

Adding the Run Shell Script action to the workflow in Automator.

Drag this action to the right-hand pane to add it to the workflow.

you’ve got the option to change it to whatever time frame you like.

Right-snag the address next to “Where,” and select “Copy as Pathname.”

Setting the default shell to bash in Automator.

Finally, paste it into the command in Automator.

Remember to ensure that /Downloads is on the end of the path.

Now, smack the “Run” button in the Automator window to fire off the workflow.

Expanding the General tab to view the path of Downloads folder.

Finally, tap on File > Save or press Command+S.

Then, name the Folder Action and click “Save.”

macOS saves all your Automator Folder Actions under the “~/Library/Workflows/Applications/Folder Actions/” path.

Copying the path of Downloads folder on Mac.

However, you’re able to avoid this by automatically emptying your Trash every 30 days.

Running the Folder Action workflow to verify if the Run Shell Script action returns right files and folders.

Run Shell Scription action results.

Saving a Folder Action workflow in Automator.