Feb 09, '09 07:30:02AM • Contributed by: cakeria
I started to look around and found two scripts here on this site:
- A shell script to empty older items from the trash
- An AppleScript to create a size-limited trash can
This script will only run when you delete a file, and it's not very complicated but it works. It securely deletes files in the trash after seven days (you can pick any number you like; this works for me because I know I'm not going to use the files anyway after having them in the trash for seven days). Here's the code: Save the code as a script in the folder /Users -> your_username -> Library -> Scripts -> Folder Action Scripts, then open the app Folder Actions Setup (in the Applications -> AppleScript folder), and manually add the folder ~/.Trash as an action folder, and then add this script to it. Then try trashing! (If you're lazy, trashtimer will be the better option for you, because it's even easier to install.)
[robg adds: I haven't tested this one. As with other trash-related scripts, keep in mind this will only work for files in the trash on your boot drive or partition; if you've got more than one drive or partition, you'll need to modify the script to work properly with the other trash cans.]
