Selectively shred files with an Applescript droplet

Apr 29, '05 07:08:00AM

Contributed by: GlowingApple

Since my discovery of the wonders of OS X, I have had a gripe about the way the Finder handles files with the Trash. In Windows, I would frequently delete a file permanently without ever putting it in the trash. Occasionally I like to delete files but leave them in the trash for a time until I'm absolutely sure I want to permanently get rid of them. Later, I'll find a file that I want to delete immediately to save disk space without emptying the trash (as the other files I wish to retain are already there).

Take this example. I just emailed a set of pictures to a friend, and then trashed the folder to keep my Desktop organized. But I don't want to empty the trash just yet -- I want to wait until I hear back from my friend to ensure that he/she successfully received the pictures. Later, I finished burning a CD of my favorite Linux distro (Gentoo), and I want to permanently delete the ISO image to save space on my hard drive. Without doing a little fancy Terminal work, there is no easy way to permanently delete the ISO file without emptying my trash and also permanently deleting those pictures.

This is where my script comes into play. This AppleScript iis meant to be used as a dropplet (so save in an Application Bundle from Script Editor). Dragging and dropping files onto it will prompt first and then permanently shred the files (using rm -rfP). Just to add more functionality to the script, I added an option to shred all the files in the trash by opening the application regularly.

Also, here's a link to the entire thing in an application bundle, with icon. As always, suggestions, comments, and modifications are welcome!

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050424215434272