1
I'd like to be able to utilize such a shortcut without having to actually be in Finder looking at the folder whose contents I want to delete. For example, I could be surfing the 'net and suddenly decide that I want to delete all the contents of my "downloaded pictures" folder, so I just click a shortcut key, or set of keys (Shift+Command+Space bar, or whatever) and the files are moved to the trash.
Thanks.
I'm using OS X 10.6.2.
By the way, this script won't put your files in the Trash, but remove them forever-ever. – trolle3000 – 2010-02-05T00:06:51.387
rm -rf /Users/your_username/Downloads/* will delete the contents of a folder (and the contents of any folders in that folder) but will leave the Downloads folder intact. The automator action Run Shell Script will let you save it as an automator app, which can then be opened in numerous ways. If you want to save the script for double clicking and avoid automator save it with the extension .command instead of .sh – ridogi – 2010-02-05T01:28:03.963
@ridogi, that doesn't remove hidden files. Removing the directory entirely and then creating it again will do that. – trolle3000 – 2010-02-05T02:00:37.960
True, but adding a second line rm -rf .* /Users/your_username/Downloads/ would solve that if removing hidden files is actually necessary. I suggested it because deleting the folder could cause other side effects—perhaps an application would get confused if it's assigned downloads folder goes missing. Your method will work too, just providing an alternative method. – ridogi – 2010-02-05T04:45:31.920
Well, didn't know that one ;-) Then we have to solutions. – trolle3000 – 2010-02-05T17:42:43.667