Removing OS X “Open With” Duplicates

8479758031_b504e9bb2f_z

Most of the time Finder will show you multiple entries for each application when right clicking a file and choosing Open With. Getting rid of Open With duplicates gives us an alias to remove those duplicates. Below is not only the alias, but a one-line command to add the alias to your ~/.bash_profile. Just copy and paste it onto the shell and you’ll have the fixopenwith alias available.

Above that the version below is a slightly improved version: not only will it rebuild the index, it’ll also relaunch Finder and open TotalFinder (if you have it installed) after having rebuilt the index.

echo "alias fixopenwith='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder && open /Applications/TotalFinder.app'" >> ~/.bash_profile

Once done, just call fixopenwith and it’ll do it all automatically.

(via )

Note: also to be found in Mathias’ dotfiles, an exquisite resource I’ve been cherrypicking from lately 🙂

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Unless noted otherwise, the contents of this post are licensed under the Creative Commons Attribution 4.0 License and code samples are licensed under the MIT License

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.