Dave Girard's 101 Autodesk® Maya® Tips is now available in Kindle, interactive iPad edition and DRM-free EPUB/PDF editions. Work faster, cry less. Read more about the ebook.




Follow cgbeige on Twitter

Topics by tag:



Recently published articles by Dave G:



Free downloads by Dave G:



Mac OS X-only downloads:

Actually Empty Trash – Automator Workflow for OS X to Empty Trash if Items Are Open

The OS X Mavericks upgrade has been pretty painless for me but one thing that seems to be an issue is that QuickLook likes to lock onto files so they think they are open. It’s trivially easy to get the “File in use” error when trying to empty the trash now. Until Apple fixes it, you can try the Secure Empty Trash, but that will be slower since it does multiple passes to write zeros over the space on the disk where the file data was before. This is potentially more of a problem also, if you don’t have backups since a disk data recovery tool won’t find these files. So I made an Automator version of the two-line shell script I use to empty the trash in these cases:

rm -rf /Volumes/*/.Trashes
rm -rf ~/.Trash

That actually deletes the trash folder but the OS recreates one with proper permissions anyway. The Automator workflow can be downloaded here: Actually_Empty_Trash.zip

See it in action:

Use the Shortcuts panel of the Keyboard system preferences to add a hotkey to the service and you’re set:



The script is not dangerous and there is no way it will ever delete anything not in the Trashes folder but, nevertheless, it comes with no guarantees.

0 notes | Permalink