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 XThis 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:
/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"
Same command string broken into multiple lines:
lsregister -kill -r -domain local -domain user
(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:
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” AliasIf 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:
- Paste in the following alias onto a single line of .bash_profile, rename the alias if you feel like it
alias fixow='/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"'
- Hit Control+O to save, then Control+X to exit nano
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.