erikjansson Posted March 25, 2013 Posted March 25, 2013 Ported Trevor Williams' v1 script to a workflow. It empties your trash with force (ignoring if files are locked or in use). Download here. Enjoy! –Erik
kimroen Posted March 26, 2013 Posted March 26, 2013 (edited) Neat! If you have multiple drives, this doesn't empty the files that were in those though. Does anyone know which folder os x puts those in? Edited March 26, 2013 by kimroen
stouty Posted March 26, 2013 Posted March 26, 2013 /Volumes/*/.Trashes Probably need sudo privileges to get at all files though. I have an alias: alias emptytrash='sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl' but that of course prompts me for my password. Anyone know of a way to get sudo privs in a workflow? NOPASSWD=/bin/rm and ssh to localhost with authkeys? ... poor security though.
sebbo Posted March 28, 2013 Posted March 28, 2013 For sudo, I've been using AppleScript: do shell script "sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" with administrator privileges You get prompted with a standard OS X authentication dialog box. leoofborg 1
stargOOse Posted March 28, 2013 Posted March 28, 2013 Ported Trevor Williams' v1 script to a workflow. It empties your trash with force (ignoring if files are locked or in use). Download here. Enjoy! –Erik Doesn't work for me
erikjansson Posted April 9, 2013 Author Posted April 9, 2013 Doesn't work for me Installing the workflow or the actual script? Nothing fancy going on, so not sure how to help!
leoofborg Posted July 26, 2013 Posted July 26, 2013 (edited) The script doesn't work because you MUST enter a password to sudo. I've modified Sebbo's commands as you might need the Apple System Logs, and put it into an NSAppleScript command. So here it is. This script will work on locked and busy files, which is why you'd force empty the trash, right? You've been warned. For any sudo command, you MUST put it into an NS and not a background OSA script because you have to enter your admin password ONCE for every sudo session. That's just how Unix (even in OSX) works. So yes, you will get that auth dialog, you'll key in your admin password (you're on the sudo'ers list, right?), then feel remorse as that file is never coming back. https://dl.dropboxusercontent.com/u/532682/Force%20Empty%20Trash.alfredworkflow The most current version that I'll be tweaking will be at Github: https://github.com/leoofborg/Alfred_Force-Empty-Trash- This was hacked together late last night on a whim with no coffee. Then modified today, still no coffee. Test: Locked file on the desktop, move to trash. Original v2 script: FAIL This v2 script: PASS Do as thou wilt. -Leo (don't make me read forums late at night) Edited July 26, 2013 by leoofborg
johns2s Posted January 4, 2014 Posted January 4, 2014 I love it.. thanks. just what I was looking for .. force empty trash, does what it says:) OSX mavericks..
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now