How Do I Delete All Files in Downloads Folder with a Hot Key?

files_folders

#1

Hi all,

I'm new to this, I would like to set up a keyboard shortcut to delete everything in the downloads folder, I tried "delete file" and the downloads folder but it failed.

Can anyone recommend a macro?


#2

@jasonbb, I hope you don't mind that I have revised your topic title to better reflect the question you have asked.

FROM:
New user help with macro

TO:
How Do I Delete All Files in Downloads Folder with a Hot Key?

Providing a succinct, yet descriptive title about your problem/issue will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.


Now, to answer your question:

You can try a For Each action with a Collection of items in a folder (where folder is ~/Downloads), and then use the File Actions action (with Delete) acting on the For Each variable.

Let us know if you need more help.


#3

Remember to ensure you have good backups before automating a task that goes around deleting files and folders.

I would also recommend you use the Trash a File action rather than the Delete a File action (and in any event, the Downloads folder tends to be full of packages which are folders, so you would need to use the very dangerous Recursively Delete a File action).


#4

Hey Jason,

This is easily and safely done with AppleScript.

All items are moved to the Trash, so you can recover if you make a mistake.

-Chris


Move Items in Downloads Folder to the Trash.kmmacros (5.2 KB)