Remove Duplicates from OS X “Open With” Menu

Have you ever right/command-clicked on a file, chosen “open with” and noticed multiple entries for an app? Every time one my apps from the Mac App Store has an update, I get a duplicate entry for it in my “Open With” context menu.

A quick Google search will show you that it’s easy to reset this menu with this shell command.

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

You can open a terminal window, copy-and-paste that command in the window, and then hit enter. After that, you’ll want to restart the Finder, by pasting this into a terminal window and then hitting enter.

killall Finder

That’s all fine and well, but that first command is way too long to remember, and I got tired of Googling it every time I needed to reset the “open with” menu. It would be nice if there was a way to automate this. Enter Automator…

Creating a Service to Reset the “Open With” Menu

Automator is an app included with OS X that allows you to… wait for it… automate tasks. It’s trivial to create a quick automator task to reset your “open with” menu.

Open Automator. You can do this by pressing ⌘ + spacebar to open spotlight, and then start typing “automator”. Or you can find it under Applications > Automator.

Select “Service” from the dialog box.

Automator screen shot

In the actions search box type “Run Shell” to filter the list. Then drag the “Run Shell Script” option onto the workflow window.

Automator screen shot

In the run shell script window remove “cat” and replace it with:

#Reset LaunchServices
Database/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

#Restart Finder
killall Finder

Automator screen shot

In the “Service receives” drop down (above the code window) choose “no input” in “Finder”.

Finally, choose File > Save… and then name the service “Reset Open With Menu”. Close Automator.

Now if you find duplicates in your “open with” dialog, you can go to Finder > Services > Reset “Open With” Menu to remove the duplicates.

Automator screen shot

comments powered by Disqus