Jul 21, '09 07:30:00AM • Contributed by: lanny
#/bin/sh
cd ~/.Trash
dirs=`find ~/.Trash -type d | wc -l`
fils=`find ~/.Trash -type f | wc -l`
byts=`du | tail -1`
(( dirs = dirs -1 ))
echo "$dirs: directories"
echo "$fils: files "
echo "$byts: bytes "
rm -Rf ~/.Trash/*
echo Return code: $?
To try, you can open an empty file in a text editor, copy the code, and save the file (i.e cleantrash.sh) on your Desktop. Then control-click and choose Open With from the conextual menu, and select Terminal from the list of apps.
[robg adds: I tested this one, and it worked as described. For more on Platypus, see this older hint. (The URL for the app has changed, though, so use the link above in this hint. Finally, this previous hint covered emptying the trash via script in a somewhat different manner. Check your trash before testing this script, just in case there's something there you really want -- it'll be gone for good once you run the script.]
