Dr. Drang had up a good post a few days ago removing duplicates from the Open With command. The problem affects not just Open With but a few other places. I actually have a small script I run once a week that deletes a bunch of commonly corrupted indexes, clears out various caches and so forth. I’d be cautious with this. I only run it when I’m not using the computer so I don’t screw up some application that is using the cache right then. At the moment I’ve been running it manually although I’ve been thinking about scheduling it to run automatically once a week using launchd. (Probably via Lingon)
The script is fairly straightforward.
One major caveat. There is some risk in deleting the system caches at /Library/Caches. I’ve never had trouble but you potentially could screw up something that is using it. I’ve heard of people occasionally having trouble with Spotlight until Spotlight runs its maintenance processes. Once again though I’ve yet to run into problems. However there are a lot of big unnecessary files there. Caches being what they are it’s always possible to have some corruption screwing things up. In general applications (including system processes) should clean up caches when they are done and eliminate old ones when they first run. But not all programmers do that.
The other odd thing I do is move all the files off my desktop into a directory called Temporary Files I keep. I am occasionally bad about using the desktop to store things. This is bad because it means there’s more process to handle the display of all those files. But it’s also just bad organization. This forces me to remember not to put those things there but also is a bit of an incentive to ensure I file things appropriately. Honestly 90% of the files that get moved are just screen captures that need dumped anyway.
It’s possible I’m doing something I shouldn’t be doing with this. As I said I’ve yet to have problems but I’d be interested if you can give a good reason not to clean out something I’m cleaning up.
(Edit: Dr. Drang had a good addition so I’ve added that to the script although if you delete the mail envelope you don’t need to vacuum it.)