Remove Duplicates from the “Open With” Right-Click Menu in Mac OS X

The “Open With” menu appears when any file in the Mac Finder is right-clicked (or control-clicked), and it is intended to provide a list of alternate apps that selected file can be opened with other than what is currently set as the default application. This Open With is great, but sometimes it can become freakishly cluttered with repeat entries of the same app, and in the worst cases it won’t even just be a duplicate here and there, it will be multiples of the same app appearing in the Open With list. We’ll show you how to remove these repeat entries and how to make an easier to use alias for future uses.

Remove Repeat App Entries in “Open With” Menu of OS X

This should work with just about every version of Mac OS X

Launch Terminal from the /Applications/Utilities/ directory and enter either one of the following command string onto a single line:

Copy & paste from single line command string:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"

(Note: the backslashes within the second command are used to extend long commands to multiple lines while still making them executable when copy & pasted, they are not necessary to include if you are manually typing the command string into the terminal)

This may take a while as the entire Launch Services database has to be rebuilt, and in that rebuilding process is where the duplicate app entries will be removed from the right-click menu. Once this is finished, you must then quit and relaunch the Finder for the change to take effect, that is easiest to do from the command line as well:

killall Finder

Now when Finder has relaunched, go back to any file and right-click on it, pulling down the “Open With” menu to see all repetitive entries gone.

But what if you have to do this often, that command string is kind of annoying huh? Here’s how to shorten it dramatically:

Creating a Short “Remove Open With Duplicates” Alias

If you find yourself having to do this more often than you’d like, creating a simple bash alias for the entire command sequence can be a significant time saver since it will remove the need to enter a lengthy series of command strings.

Open .bash_profile with your favorite text editor, we use nano for this walkthrough because it’s simple:

nano .bash_profile

Paste in the following alias onto a single line of .bash_profile, rename the alias if you feel like it

Verify the alias worked by typing ‘fixow’ at the command line, though if you already cleared Open With it won’t have the same effect. If you used the exact command string as above you’ll get a little message echoed back at you, looking like this:

$ fixow
Open With menu has been rebuilt, Finder will relaunch

If for some reason you have trouble grabbing that code, you can also copy it from the OSXDaily GitHub page, where we are starting to collect some particularly useful shell scripts for OS X.

This allows you to simply type ‘fixow’ (short for Fix Open With, get it? We sure are creative) and that entire command string will execute without having to type the entire thing again.

Can I Remove Every App From the “Open With” Menu?

If your issue is beyond the duplicate or repetitive entries, the other option is to clear out the entire Open With menu and start from scratch. This takes everything out of the menu, forcing you to manually associate apps with file types and formats on your own or just by using OS X to open particular files. That’s really a method of last-resort, or for uber-customization if you want to rebuild the list yourself and be more selective with the associations.

I believe you are right, it seems that every time an app is updated either though the Mac App Store or directly from an app itself, it adds another entry. This is easy to replicate with App Store updates in particular. Seems like a simple bug and there should be a fix in future OS X updates.

After I ran this script some features of other programs stopped working. For instance, when I download something in Google Chrome and click the icon that appears on the lower bar of the browser nothing happens.

When I attempt to click any type of link within apps that are supposed to bring up the location of something in the Finder, nothing happens. I have to manually navigate to the location of the file.

Not sure if there is a reverse for this command, or if there is a way to fix my issue, but I mind this more than I mind having a few duplicates in the contextual menu.

Love this tip, as a large “Open With” menu would cause my contextual menu to hang a bit as the entire menu loaded. This is difficult to avoid given the natural path the cursor has to travel. For a simple png file, my menu was reduced from 39 items to a faster-loading 19.

However, my Firefox is still showing 7 duplicates. Any idea what Firefox is doing differently than other apps to cause this? Any other ideas on how to stop Firefox from showing so many versions in “Open With”?

Firefox supplies versions very often, sometimes twice a month, so their app list will soon become quite long.

This website and third-party tools use cookies for functional, analytical, and advertising purposes. By continuing to browse the site, closing this banner, scrolling this webpage, or clicking a link, you agree to these cookies. You can review our privacy policy for additional information.I AcceptPrivacy Policy