Open With Menu Duplicates

I have for some time been suffering a minor (but it seems not uncommon) annoyance with the “Open With” menu when I right click on a document in the Finder. Over time a number of old and duplicate items have worked there way into the list. It seems that OS X has at some point spotted additional copies of applications and helpfully added them to the menu. VMWare Fusion has also made a contribution adding some applications from an old Windows XP image before I figured out how to disable that option. The following is what I was seeing when I right-clicked on a pdf file:

duplicate open with

Now I like Pixelmator and Evernote but there is no way I really want to see them listed five times and I have never wanted to open a pdf using Internet Explorer. I cannot say for sure when I first noticed this problem but I do know it is worse since I upgraded to Mountain Lion.

Launch Services

The Launch Services API is what controls how a running application can open a document in another application. When you open a file in the Finder what actually happens under the covers is that the Finder uses the Launch Services API to request that the associated application is used to open the file on behalf of the user.

In order to be able to respond to such requests Launch Services maintains a database in which it records all registered applications and the kinds of documents each application can open. (If you are curious you can find this database in ~/Library/Preferences/ The system takes care of registering applications with Launch Services automatically in the following situations:

Luckily you do not really need to know anything about Launch Services to clean up the “Open With” menu.

Command-Line Utility - lsregister

The easiest way to interact with the launch services database is to use the lsregister command-line utility from the terminal. Unfortunately it is buried deep down in a system library subdirectory:

$ cd /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Versions/Current/Support/

You can of course just search from the command-line if you are having problems finding it on older versions of OS X:

$ find /System/Library/Frameworks -name lsregister

The two directory paths although slightly different are actually equivalent as the Current directory is actually just a link to the A directory. Whichever path you use once you have set it as your current working directory you can reset the database with the following command:

$ ./lsregister -kill -r -all system,local,user


Finally Back To Normal

After resetting the launch services database my “Open With” menu is finally back to a clean and useful size. The following is what I now see for a pdf file:

clean open with

Several days later my menu is still looking clean so I am hoping it will now stay that way. Unfortunately it seems that this is a long standing OS X problem even though it only seems to have recently started to annoy me.

Never Miss A Post

Sign up to get my iOS posts and news direct to your inbox and I'll also send you a PDF of my WWDC Viewing Guide

    Unsubscribe at any time. See privacy policy.

    Archives Categories