Clear Recent items in Preview Application of Mac OS X..?

12,442

Solution 1

open Preview ->- go to File ->- Open Recent ->- Clear Menu

Solution 2

Ok, so none of the described methods on the websites I could find actually succeeded in getting rid of all the 'recent document' lists in all of my apps.

I feel the most common sense approach would be (for OSX 10.12 / Sierra):

  1. First go to system settings > general and choose "none" in the recent file dropdown menu (my OSX is in another language so the exact terms might be different, but you should be able to see what I mean). / This will get rid of most, but not all recent-items in different apps.
  2. Get familiar with Apple's 'defaults' command in terminal. Now, hunt for any lists you might still want to get rid off, e.g. none of the options mentioned in the answers already listed here helped to get rid of the recent-items list in Finders "GO" menu. I played around with the defaults command and found that: "write com.apple.finder "FXRecentFolders" '({})' && killall Finder" does the trick for me. Playing around I found similar solutions for many of the other apps that where still able to maintain a list of recent items.
  3. Create a shell script containing the commands you found during step 2.
  4. Schedule the script to be run automatically on a preset interval or action (e.g. log out). AND/OR create an alias in your shell's profile (or directly apply the script as a function inside it) so you can call it with a single command from your terminal. (for instance: I have created an alias to it, so when I now type "killrecent" in terminal, it empties all the recent-items lists I've been able to find.

Hope this will be of some help to others. Good luck!

Solution 3

You may try the approach outlined here, which is to run

defaults delete com.apple.Preview.LSSharedFileList RecentDocuments

in the Terminal (manually or through your app). However I tried this and it didn't work for me (OSX 10.11), since the Preview defaults file doesn't contain this entry.

You can use

defaults write com.apple.Preview NSRecentDocumentsLimit 0

which will hide all recently used items, but as soon as you set that number to anything greater than 0, they will show up again.

I also checked the ScriptingBridge Interface for Preview, but couldn't find anything useful. So unfortunately it looks like this is not possible.

Solution 4

with 10.11, there are at ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.apple.preview.sfl

Share:
12,442
Rohit Chauhan
Author by

Rohit Chauhan

I am an enthusiast Qt developer with over 9.5 years of good experience in cross platform desktop application development in native language support(like French, German) using Qt Widgets C/C++ in Linux, Mac and Windows. Customize desktop gui development with stylesheets, custom widgets and animation. Worked on project research, reverse engineering, development, maintenance, testing and providing support to clients.

Updated on June 08, 2022

Comments

  • Rohit Chauhan
    Rohit Chauhan almost 2 years

    Hello all,

    Can anyone tell me how to clear the 'Recent items' list in Preview application of Mac OS X through code? Is there a terminal command that can do this?

    Or is there any way to click on 'Clear Menu' in 'Open Recent' of the 'File' menu in Preview?

    Alternatively, does someone know where Preview stores this information and how do to remove it?

    Check out this image to see what I mean.