Six Colors
Six Colors

This Week's Sponsor

conversationtreepress.com - beautifully designed, letterpress-printed, finely bound books

By Dan Moren

Clean out a messy Open With menu in the Finder

Note: This story has not been updated for several years.

Contextual menu
Before and after clean-up

We’re used to cruft accumulating in all sorts of unwanted places in our lives, but among my least favorite is the Finder’s Open With contextual menu. You’ve probably run into this: you go to open a file with an app that isn’t the default, and you’re presented with a list of options as long as your arm—many of them duplicates (see above, left).

What gives? Well, when you install an app on your system, it registers that it’s willing to handle certain filetypes—”Oh, JPEGS? Yeah, no problem!” That information is stored in the Launch Services database, so when you right-click on a JPEG and choose Open With, the Finder rounds up a list of viable candidate applications.

Unfortunately, over time, this database accumulates that aforementioned cruft: old versions of applications don’t get cleaned, or even programs you’ve long removed. Fortunately, this handy tip—courtesy our old friends at Mac OS X Hints—can help you whip that database into a lean, mean, contextual machine.

Fire up a Terminal window and paste in the following command:

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

That uses lsregister—the Launch Services command-line tool—to rebuild OS X’s internal database, throw out outdated entries, and make sure that everything’s all up to date. When you’re done you’ll need to relaunch Finder, which you can either do from the command line—enter killall Finder—or by option-control clicking on the Finder icon in the Dock and choosing Relaunch.

Next time you use that Open With dialog box, it’ll be much, much cleaner (see above, right). Now, if only there were a similar command for those couch cushions.

Update: Whoops, the previous version of the command was for pre-10.8. This version should work with newer versions of OS X.

[Dan Moren is the East Coast Bureau Chief of Six Colors. You can find him on Mastodon at @dmoren@zeppelin.flights or reach him by email at dan@sixcolors.com. His latest novel, the supernatural detective story All Souls Lost, is out now.]

If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.


Search Six Colors