22 December 2007

"Open With" too many applications...

All this started a few weeks ago, and it is most probably related to Leopard's Time Machine. It may be related to other things too but then I have no idea what they are. The result is that you end up with duplicates of all your applications popping up here and there, first in the SpotLight result window, then in Mail, when you right-click on an attachment, in Finder too...

Sometimes you launch the backup instead of the original, and you realize when the backup disks starts to scramble like crazy...

Eventually, I found a solution. A little drastic, and maybe it was not all necessary, but it also contributed to rationalize my backup procedures.

Before:

1) Time Machine copied _all_ my disk to an external backup disk
2) I had Sync!Sync!Sync! do an extra daily backup of my whole home hierarchy (including all the "user space" applications)
3) I had Spotlight index everything

What I wanted was Spotlight indexing everything _but_ the applications.

The problem was that the Privacy setting of SpotLight did not allow for the selection of a subfolder in the Time Machine backup (like Applications, for ex).

Now:

1) Time Machine copies everything but the system Application folder, the user Application folder, the whole Developer folder and the Download folder.
2) Sync!Sync!Sync! does an extra daily backup of my whole home hierarchy, including the user space Application folder
3) Sync!Sync!Sync! does also a daily backup of the system's Application folder
4) I have Spotlight index everything (including the TimeMachine backup, of course) but the Sync!Sync!Sync! backups where all the Application duplicates are now.

I have also reindexed Spotlight using the following command in Terminal:

 $ sudo mdutil -Es / /Volumes/backup_disk_name/


And I have rebuilt the LaunchServices database, the one that contains all the "knowledge" about which application is supposed to launch which file, with the following command, also in Terminal:

 $ /System/Library/Frameworks/CoreServices.framework/\
Versions/A/Frameworks/LaunchServices.framework/\
Versions/A/Support/lsregister\
-kill -r -domain local -domain system -domain user


SInce the whole "recipe" is based on saving applications outside Time Machine, I also had to erase all the data Time Machine had accumulated for a month... Setting Time Machine to not save /Applications from any day does not remove /Applications from the previous days backup sets... There may be smarter ways to do that, but I thought that with my already existing extra daily backup I was on the safe side.

Now, I have much saner "Open With" drop down lists when I right-click a file with my mouse...