Clear and disable recent items in OS X dock and applications

Important note

This hint only applies to versions of Mac OS X up to version 10.8 Mountain Lion.

Mac OS X Lion lists recent items with each application in the Dock (accessible via right-click) and in the Application View of Mission Control. To remove those and disable future additions, the trusty defaults write approach may help with most — but not all — applications.

To clear the list of recent files, you need to find the application’s bundle identifier. See the next section on how to accomplish this.

Assuming you want to erase the list of recent items in VLC, which has the application bundle identifier org.videolan.vlc, you need to issue the following command in Terminal:

1defaults delete org.videolan.vlc.LSSharedFileList RecentDocuments

To disable listing recent items for VLC in the future, run the following commands in Terminal:

1defaults write org.videolan.vlc NSRecentDocumentsLimit 0
2defaults write org.videolan.vlc.LSSharedFileList RecentDocuments -dict-add MaxAmount 0

The same procedure for QuickTime Player X (com.apple.QuickTimePlayerX):

1defaults delete com.apple.QuickTimePlayerX.LSSharedFileList RecentDocuments
2defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 0
3defaults write com.apple.QuickTimePlayerX.LSSharedFileList RecentDocuments -dict-add MaxAmount 0

After issuing any of the above commands, you need to restart the Dock by issuing

1killall Dock

That’s it.

In order to reverse the above modification, you need to again obtain the application’s bundle identifier, then run a command in Terminal. As an example, if you should desire to keep the list of recent items in VLC (org.videolan.vlc), run the following commands in Terminal:

  defaults delete org.videolan.vlc NSRecentDocumentsLimit
defaults delete org.videolan.vlc.LSSharedFileList RecentDocuments

For QuickTime Player X (com.apple.QuickTimePlayerX), it would be:

1defaults delete com.apple.QuickTimePlayerX NSRecentDocumentsLimit
2defaults delete com.apple.QuickTimePlayerX.LSSharedFileList RecentDocuments

For these commands to take effect, you need to restart the Dock, i.e. issue

1killall Dock
defaults delete com.apple.finder FXRecentFolders

In order to figure out the application’s bundle identifier, you can either use the Terminal or the Activity Monitor.

If you’d like to go the Terminal route:

  1. Open Terminal (use Spotlight if you don’t have it in your Dock)
  2. type defaults read plus a single space character
  3. Drag the app into the window to insert its path. If the app is in your Dock, you can press and hold the ⌘ (command) key and then grab the app’s icon from the Dock and drop it into the Terminal window. Alternatively, you can also grab it from a Finder window and drop it in the Terminal window
  4. Now hit backspace once to erase the space that was added automatically by the drag-and-drop process
  5. Append /Contents/Info CFBundleIdentifier (without any preceding space)
  6. Finally, hit ⏎ (the return key) and you should obtain the bundle identifier

For example with Xcode, you would end up with the following command line in Termainal before you hit ⏎ :

1defaults read /Applications/Xcode.app/Contents/Info CFBundleIdentifier

Note that you must not append the suffix .plist to the path above, as this would irritate the defaults command.

If this sounds too complicated, you can alternatively open Activity Monitor, click the application in the list of processes and then click the “Sample Process” button. Then make sure the “Display:” popup is set to “Sample Text”.

Output for VLC:

 1	Sampling process 66975 for 3 seconds with 1 millisecond of run time between samples
 2	Sampling completed, processing symbols...
 3	Analysis of sampling VLC (pid 66975) every 1 millisecond
 4	Process:         VLC [66975]
 5	Path:            /Applications/VLC.app/Contents/MacOS/VLC
 6	Load Address:    0x100000000
 7	Identifier:      org.videolan.vlc
 8	Version:         1.1.11 (1.1.11)
 9	Code Type:       X86-64 (Native)
10	Parent Process:  launchd [175]
11	[...]

Now look for the line that begins with Identifier:, which gives you the bundle identifier in plain text. In the above exammple, we find that VLC’s application bundle identifier is org.videolan.vlc.