17

When I select a file and right click on it to use the "Open With" option I see a list of the most likely applications for opening that file, but in my case, running 10.9.5, I see three and sometimes four instances of each recommended application for opening that particular file - see attached screenshot. Why is this? Is there a way to reduce that to one instance per app? If so, how?

enter image description here

  • Mike, I admire your diligence in monitoring, however, my question is so much clearer than the alleged duplicate. The amount of views is testimony to its validity. Based on the title alone you would never know it was even the same subject. – fmz Oct 15 '14 at 16:46
  • We close questions all the time when they restate the problem and point to one place for all the answers. Had your question not been a good and clear rephrase of the issue, I would have deleted it entirely after linking it. Feel free to edit it or ask on meta if you can help us point to a better canonical answer to how to correct launch services. It's something that has been around for a long time and I don't see it changing anytime soon. – bmike Oct 15 '14 at 16:52
  • And, as always - ask a question on Ask Different Meta if you aren't sure why something was moderated or want to have a different outcome than the current situation. More eyes on the thread often helps everyone - me included. Thanks for the feedback. – bmike Oct 15 '14 at 16:53
15

Rebuild LaunchServices to Fix Duplicate Entries in OS X’s ‘Open With’ Menu

To fix this, we need to reset OS X’s LaunchServices database. As is the case with most actions in OS X, there are multiple ways to accomplish this task, but the fastest is to simply use a Terminal command.

From that article- Copy following in to your Terminal

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
  • Is your solution equivalent to grgarside's. My Terminal-fu isn't good enough to accurately parse them, but they look like they should be similar. – Tetsujin Oct 13 '14 at 17:15
  • 1
    @Tetsujin They are equivalent. The globbing in the former expands to the latter path. – grg Oct 13 '14 at 17:19
7

This is a long-standing bug in OS X. You can fix it with lsregister:

/Sy*/L*/Fr*/CoreS*/F*/L*/S*/lsregister -kill -r -domain local -domain system -domain user
  • 1
    Would you be so kind and provide some references, you know just a standard procedure for all of us. – Ruskes Oct 13 '14 at 23:32
  • 1
    @Buscar I have no specific citation—it's one of those commands I have in one of my reference lists. – grg Oct 14 '14 at 13:59
  • 2
    Heh, looks like something straight from Code Golf ;) – Doorknob Oct 15 '14 at 0:26
4

In addition to the other answers, it can show multiple copies that exist on other hard drives or backup copies. An external hard drive that you use for Time Machine backups may show up as an option if your Applications are backed up to that drive.

If you're curious where the apps are coming from, open up one of the other applications. Then from the Dock, control+click on the apps icon and choose: Options > "Show in Finder". This will show you where the application is.

Use the command line provided by Buscar웃 to update your system's LaunchServices.

2

To expand on the answers provided by grgarside and Buscar, you can make it slightly less of a pain by defining an alias in your .bashrc script. To do that, open Terminal.app and with you favourite text editor (vi, nano, emacs if you're so inclined) edit .bashrc to add the following line at the very end:

alias rmdup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain user; killall Finder"

Note, that the rmdup is just an alias name I've chosen to easily remember the command later (it's meant to expand to 'remove duplicates'). You can choose any other alias name you like, just be careful you don't use a name already used for another command.

After having changed your .bashrc, when you notice duplicate applications again, you can just open Terminal.app and type rmdup or whichever other name you chose, instead of the full path to the lsregister command with all its arguments, etc.

Not the answer you're looking for? Browse other questions tagged .