Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two hard drives on my machine (Lion). One contains the regular copy of OS that I use everyday, the one has a slightly older copy of the OS that I keep as a backup (in case the first drive stops working).

A somewhat annoying problem is that whenever I right-click on a file and go to "Open With", two entries for each application I have will show up in the cascading menu, one from each copy of an application from the two drives. The one from the everyday-use-drive will have a newer version because I update them regularly (This way I can tell which app to use).

I looked around the documentation and it seems like I can use Launch Services

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister

but I haven't found any example that does exactly what I am looking for. Any ideas? Thanks!

share|improve this question
    
Unmount the other partition? –  Daniel Beck Oct 21 '11 at 12:28
    
I don't want to do that because I have some other files (that I actively use) in the same drive. –  ceiling cat Oct 21 '11 at 17:34

1 Answer 1

up vote 5 down vote accepted

Try this procedure:

  1. Exclude your second drive from Spotlight indexing (or, if you want to keep access to it via Spotlight, just exclude its /Applications folder) by dragging its icon into the Privacy pane of the Spotlight System Settings. This will preclude Launch Services from seeing the apps on the drive and re-registering them in the next step.
  2. Make Launch Services reload the list of available apps with the command /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -all local,system,user. As apps on the second drive are not available via Spotlight anymore, the new database will only contain those on your main drive.
  3. Restart Finder to rebuild its Open With context menu (Option-right click on its Dock icon to get the restart option, or do killall Finder in Terminal).
share|improve this answer
    
awesome! Worked perfectly. –  ceiling cat Oct 21 '11 at 17:33
    
but then "find" (files and folders) feature won't work on that external drive :( –  Nimbuz Aug 1 '12 at 7:20
    
@Nimbuz: that is so if you exclude the whole drive, as the find feature is Spotlight. However, as I pointed out in the answer, you can keep finding anything but apps by only excluding /Applications on the external drive. –  kopischke Aug 2 '12 at 8:03
    
There is no option to disable indexing for external drive only. You just enable or disable it. –  Nimbuz Aug 3 '12 at 7:55
    
@Nimbuz: You can add individual folders to Spotlight’s privacy pane from any drive – external or internal. Just follow the instructions in the answer. –  kopischke Aug 3 '12 at 9:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.