I wrote this short script when I needed to clean up my Downloads folder (but it can be used on any folder). It looks at when you last accessed each file in the folder, and if it is more than a set number of days old (14 by default), it either prints out the name of the file, moves it to the trash, or deletes it.
Save the file somewhere as clean.rb, and in the Terminal (Applications > Utilities), cd to the directory (e.g., cd Desktop if it's on your Desktop), and type chmod +x clean.rb. If you want, you can edit the top of the file. There are two settings: what you want to do with the file (list, move to trash, or delete), and how long it must be since you accessed it. You can then run the file by typing ./clean.rb Downloads, for example. It will clean out or list the files according to your preference. It will only remove whole directories. Hope this is useful to everyone here!
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060831174513296