Tired of right-clicking (control-click or two-finger click on trackpads) on a file and seeing a ton of duplicates in the Open With… contextual menu pop up? Not only is it aesthetically annoying, it takes up valuable real estate on smaller screens, and makes you move your mouse cursor more than you should, which could lead to repetitive-stress injuries. Or, you know, a tired finger or three.

Anyway, if you want to get rid of those duplicates, try the following.

Launch Terminal app from your Utilities folder or Dock, and enter the following command:

/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"OR

You want to be sure you copy and paste that whole command there, from the /System to the relaunch"OR to be sure you get it right. It could take a bit of time, depending on how many apps you have that you can Open With, er, with.

If successful, you’ll get the following message:

Open With has been rebuilt, Finder will relaunchOR

Now right click on a file, and it’ll be all nice and pretty, with nary a duplicate entry to be found. Pretty slick! This should work with pretty much every version of OS X, but let us know if it doesn’t in the comments below.

Worked for me, thanks. How would I use this as a script to run every time I log in, for instance?

I say this because I’ve heard that updates from the App Store are the cause of this duplicate list.

SanityFox

Cult of Mac appends copy/paste info to items you copy off their page. Paste it into a text program first, remove the extra bit and then copy paste again into the terminal.

airmanchairman

Yeah, caught that in time to remove it from the Terminal command line before hitting the key. Saved in TextEdit for re-use, but I’d like to include it somehow in a profile so it runs on every login rather than input it manually every time OpenWith goes wonky… ideas?

About the author

Rob LeFebvre is an Anchorage, Alaska-based writer and editor who has contributed to various tech, gaming and iOS sites, including 148Apps, Creative Screenwriting, Shelf-Awareness, VentureBeat, and Paste Magazine. Feel free to find Rob on Twitter @roblef, and send him a cookie once in a while; he'll really appreciate it.

(sorry, you need Javascript to see this e-mail address) | Read more posts by Rob LeFebvre.