When your right-click option for Open With lists duplicate apps, even those that were uninstalled long ago, your Mac is in desperate need for a major refresh.

Right-clicking any file in Mac OS X will display the Open With contextual menu. It provides a list of alternatives to the default app that selected file can be opened with. It is a convenient, time-saving way to open files. However, from time to time the Open With menu can become a nuisance with unnecessary, missing, duplicate and ghost apps.

My young son and his close friend ripped a DVD on the former’s computer. They came across duplicate apps when they tried to open up the M4V file in VLC. I seized the opportunity to pen this piece as I fix the problem. 

Hä, wie ist das denn passiert?

The behaviour where the same app has repeated entries is often seen with apps that were downloaded and installed from outside the Mac App Store. Photoshop, HandBrake and VLC are among many examples. When these apps are updated, there may be multiple instances of each app in the Open With menu. Sometimes apps that have been uninstalled remain in the Open With menu. This doesn’t happen with updates for apps from the Mac App Store.

Advertisement

There is no preference pane within the System Preferences for the Open With menu. In order to rid the Open With menu of duplicate and ghost apps, the Launch Services database will have to be rebuilt. The database is where all of the Open With menu entries are stored. There are two ways to rebuild the database: using Terminal and deleting a file in a hidden folder.

Method 1: Terminal

Terminal is a terminal emulator. It is a tool that provides direct interaction with the engine room of the OS. The jumble can be cleaned up effortlessly using only two commands.

Step 1 — Open the Utilities folder or simply press ⇧⌘U and launch Terminal. Copy and paste the following command into the Terminal window:

Advertisement

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

Step 2 — Press Return (⏎), and Terminal will rebuild the Launch Services database. This may take a minute for the database to restructure itself.

Step 3 — Type the following command into the Terminal window:

killall Finder

Press Return, and Terminal will terminate the Finder process running in the background. Once terminated, the process restarts instantly, refreshing Finder. All duplicate and ghost apps will disappear from the Open With menu.

Method 2: Deleting the File

The other way to rebuild the Launch Services database is by manually deleting its .plist file. Property List (plist) is a format for storing app data. .plist files can only be found in the Library folder, which stores per-user resources, settings and support files. There is a catch: This Library folder is hidden.

Step 1 — Choose Go to Folder... from the Go menu or simply press ⇧⌘G. Type the following path into the text field:

~/Library/Preferences/

Press Return to reveal the hidden folder and proceed to the next step.

Step 2 — Look for the com.apple.LaunchServices.plist file and drag and drop it into the rubbish bin. By default the Preferences files are in alphabetic order.

Step 3 — Empty the rubbish bin, and Finder will automatically create a new .plist file to replace the missing one and refresh itself. The heap of duplicate and ghost apps will vanish from the Open With menu.

Once Finder is refreshed right-click on any file and pull down the Open With menu. You will notice the behaviour has return to normal.

Other Tips

  • If your Mac has multiple users (i.e. family computer), use this path instead:

/Library/Preferences/

  • (...continued) The difference is the absence of a squiggle (~). This is another hidden Library folder that stores resources, settings and support files for all users. When the .plist file is deleted from this Library folder, Finder will create a new one and refresh itself for all users.
  • It doesn’t matter how the rubbish bin is emptied: normally or Secure Empty Trash (OS X 10,10 and earlier). Once emptied, the OS will simply disregard the deleted .plist file and create a new one to replace it.
  • If both methods don’t work, try restarting the computer. If that doesn’t work, you may have to uninstall and reinstall all apps that are affected by this behaviour.