On OS X I had always hacked around this by changing the hidden trash folder, ~/.Trash into a file - which confounds whatever cat-named operating system I am running and pops up a dialog telling me that the file will be deleted immediately since it cannot be written to the trash. This hack fails in two ways, first I have to see a dialog, second sometimes the system would get confused and end up with the trash full icon.
I decided to actually fix this the right way tonight. Yes, I could actually pay for software which can do this - but that is rather silly. I hacked around with someone else's AppleScript and set it up as a folder action to automatically empty the trash when I put something into it. This pops up no dialogs and gives me a satisfying flip-flop of the trash icon from full to empty. Maybe you want this too... I dunno, but here it is.
on adding folder items to this_folder after receiving added_items
try
set trash_files to (list folder this_folder)
repeat with i from 1 to the count of trash_files
set a_file to alias ((this_folder as text) & (item i of trash_files))
set sh_script to "rm -rf " & quoted form of (POSIX path of a_file)
do shell script sh_script
end repeat
end try
end adding folder items to
So... I tried this out, and it seems to work great. Just like you said, as soon as I delete a file, I get the sound and the trash can icon fills and then empties. But now I can't figure out how to get my file back. When I go into the trash/recycle can thing, the directory is empty. I had a lot of stuff in there I really needed. It isn't gone now, is it? How do I access those files? Quick response appreciated, as I had some files I need for work that were in there, and I have to finish this project this weekend.
ReplyDeleteThanks! And neat script!