Mar 29, '07 07:30:02AM • Contributed by: plagarri
I had to put an identification string (_@_) at the beginning because the Repeat loop takes the newly renamed files into account, which produces a never-ending loop. Maybe somebody can find a better solution.
I used Folder Actions (implemented on OS X 10.3 and newer) on the Trash folder (~/.Trash) to let this script run as soon as a file or folder has been put inside. Copy/paste the script into the Script Editor and save it as and Application under the name ToTrash into ~/Library -> Scripts -> Folder Action Scripts to use it in this manner.
To accompany this script, I have written another that then checks the renamed files and deletes those older than a specified age. The number of days (which is presently set to 15) can be changed in the perl part of the script (localtime(time - 15 * 86400);). The path Macintosh HD:Users:user:.Trash: must be customized to match your machine.
[robg adds: I haven't tested these scripts.]
