How to Remove Duplicates & Customize the “Open With” Menu in Mac OS X

Aug 28, 2014 06:38 PM
Aug 28, 2014 07:17 PM
635448220801081769.jpg

As a regular Mac OS X user, I have a love/hate relationship with the "Open With" contextual menu. Sometimes, it has just what I need. Other times, it's often packed with unnecessary or duplicate items, or missing the app I want to open the file up with the most.

Unfortunately, the "Open With" right-click menu does not have its own preferences, so there is no one way to fix all of these issues. But with a little work and determination, you can finally get the "Open With" menu exactly how you want, for every filetype on your Mac.

How to Clean Up Duplicate Apps in "Open With"

One of the biggest problems with the "Open With" menu is duplicate applications. If you're getting app updates from the Mac App Store, this usually will never happen, but if it's an app you installed from outside the Mac App Store, like Spotify or Photoshop, you'll sometimes see multiple instances of each app in the "Open With" options.

635448191148737767.jpg

In order to get rid of duplicate apps, you'll need to rebuild the Launch Services database, which stores all of the "Open With" options. Below, you can check out three different methods for doing this. Depending on what you're comfortable with, you can either use Terminal commands, trash a .plist file, or use a third-party app.

Method #1: Use Terminal to Clear Duplicates

On my Mac, I currently have duplicate Spotify versions showing up whenever I try to open up an MP3 file. Below, you can see the before (with 3 versions of Spotify) and after (with only the latest Spotify version).

635448196781706988.jpg

Open up Terminal and enter the following two commands, each followed by the Enter key. These commands will rebuild the LaunchServices file and will refresh the Finder so that the changes take effect. You might have to wait a minute or two for the first command before killing the Finder, as the database needs time to restructure itself.

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

killall Finder

635447388494218496.jpg

All of the duplicates that previously appeared in "Open With" should now be gone. If you're not comfortable using Terminal, try out the next method.

Method #2: Manually Delete the LaunchServices File

One of the easiest ways to clear duplicate apps is by manually deleting the LaunchServices preference file. Doing so will cause Mac OS X to rebuilt it, choosing only the latest versions of each app.

  1. With Finder open, hold down on the Option key on your keyboard while clicking on Go in the menu bar.
  2. Select Library.
  3. Open the Preferences folder.
  4. Find the com.apple.LaunchServices.plist file and trash it.
635447397912827699.jpg

Afterward, make sure to close all applications before clearing your Trash, so that the .plist file can properly deleted. If it doesn't work right away, restart your computer for all of the changes to take effect.

Method #3: Use OnyX to Do It for You

Lastly, you can also use a third-party app in order to rebuild your LaunchServices .plist file.

  1. Download and install OnyX by Titanium Software. Make sure to choose the right version for your version of Mac OS X.
  2. Enter your admin username and password to install. You may need to go into the Security & Privacy settings in your System Preferences to allow the installation from outside of the Mac App Store.
  3. Open up OnyX and go to Maintenance -> Rebuild.
  4. Check the box next to LaunchServices.
  5. Click Execute.
635447405896406059.jpg

OnyX will then close all of your applications and rebuild your LaunchServices .plist file for you.

How to Delete a Specific App from "Open With"

While clearing the LaunchServices .plist will clear any duplicates, it won't get rid of an unwanted app that appears under the "Open With" menu. For this section of the guide, I will be deleting Firefox as an option for opening screenshots, which have a .png extension.

635448210016238849.jpg

To ban a specific application from appearing under "Open With" for a certain file, do the following.

  1. Go to the app you want to ban and right-click on it.
  2. Click on Show Package Contents.
  3. Open the Contents folder.
  4. Open Info.plist with any text editor, like TextEdit.
  5. Look for CFBundleTypeExtensions, which should show up several times. Under that, you should see a few lines that have file name.
  6. Once you find the suffix you want to take off (in my case. it's the png line), delete it from the text editor and save the file.
  7. Lastly, open Terminal and enter the killall Finder command.
635447483396922071.jpg

Now when you select the "Open With" option, the app will be gone.

How to Add an App to "Open With"

Now that I've shown you how to get rid of an app, I'm going to show you how to add an app to the list for a certain file. I will be adding Firefox to the list of options that show up for .mp3 files.

635447490428797667.jpg

Similar to the process above, you'll need to right-click on the app, select Show Package Contents, open the Contents folder, and open the Info.plist with a text editor. Then, between any two and , add the following:



CFBundleTypeExtensions



url



635447489278015967.jpg

Save the file, then go to Terminal and enter the following two commands to save the changes.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/TextEdit.app/

killall Finder

Now when you open a certain file (.mp3), you'll see the application that you've added (Firefox) as an "Open With" option.

How to Set an App as the Default Option in "Open With"

Lastly, I'm going to show you how to set an app as the default "Open With" option for whenever you just want to double-click on a file and open it up directly.

  1. Right-click on the file.
  2. Select Open With.
  3. Click on Other....
  4. In the window, find the app you want to open the file with and check the box next to Always Open With at the bottom.
  5. Select Open.
635447507437234874.jpg

Alternatively, you can do this by right-clicking on the file and choosing Get Info (keyboard shortcut Command + I). Then just select the app you want as the default under the Open with: section, and click on Change All... to complete the action.

635448214724051121.jpg

Now every time you open a file with a certain extension using a double-click, it will open with the default app.

If you guys have any other problems with the "Open With" contextual menu, let us know and we'll see what we can do.

Comments

No Comments Exist

Be the first, drop a comment!