How to prevent Preview from opening files when it launches

16,906

Solution 1

Quit Preview.

Navigate to ~/Library/Saved Application State/com.apple.Preview.savedState/

Quick way to get there…

  • From Finder...
  • Cmd ⌘ N for new window

  • Cmd ⌘ Shift ⇧ G for Go To…

  • Copy/paste ~/Library/Saved Application State/com.apple.Preview.savedState/

  • Hit Enter

Delete the entire contents of the com.apple.Preview.savedState folder.

Late Edit: I've noticed the Preview saved state folder is now an alias in more recent OSes; in which case when deleting the contents, don't also delete the alias. The original is in ~/Library/Containers/com.apple.Preview/Data/Library/Saved Application State/com.apple.Preview.savedState

Solution 2

There are two options for doing this without having to touch config files:

  • To do this one time only, you can hold down Shift ⇧ while opening any app to temporarily disable the "reopen windows on launch" feature
  • To disable this behavior for all apps indefinitely, open System Preferences, go to General, and check "Close windows when quitting an app" near the bottom.
Share:
16,906

Related videos on Youtube

Jens Axel Søgaard
Author by

Jens Axel Søgaard

Updated on September 18, 2022

Comments

  • Jens Axel Søgaard
    Jens Axel Søgaard almost 2 years

    The Preview application currently hangs when it opens (it doesn't crash - it becomes unresponsive). Since Preview opens the files that were opened at the last invocation - killing and reopening Preview doesn't help.

    Switching to the guest user proves that the Preview application works.

    Where does the Preview application store the list of files to open at startup?

  • Jens Axel Søgaard
    Jens Axel Søgaard over 9 years
    Thanks for the solution. Instead of deleting the folder, I opened windows.plist and removed items with files to open. Thanks again.
  • Tetsujin
    Tetsujin over 9 years
    Sure - if you're comfortable editing xmls, cool - I was going for the 'lowest common denominator' method ;) Glad it worked.
  • Tetsujin
    Tetsujin over 7 years
    @jaepage - are you looking in ~/Library or /Library ??
  • Tetsujin
    Tetsujin over 7 years
    hmm.. neither do I on El Cap. I also notice Preview has changed behaviour since I wrote this [mine is 8.1 under 10.11]. It no longer re-opens its last files, even if that's set as a general system pref.
  • bames53
    bames53 almost 7 years
    The built-in feature for disabling Application Restore when opening an application should be preferred over this.
  • Tetsujin
    Tetsujin almost 7 years
    @bames53 - why? that would clear all saved states for all apps. Elephant gun/house fly.
  • bames53
    bames53 almost 7 years
    @Tetsujin No, it merely starts up the application without restoring its state. It doesn't do anything to the state for other applications.
  • Tetsujin
    Tetsujin almost 7 years
    Even so, I'm still not seeing the point. If it doesn't delete the state, then as soon as you switch it back on again it will do the same thing, try to open the file that hung... in the meantime, everything else will forget its state too.
  • bames53
    bames53 over 6 years
    @Tetsujin "If it doesn't delete the state" Opening an app without restoring the old state doesn't disable saving state, so the old state gets overwritten. "in the meantime, everything else will forget its state too," No, that's not true. Opening an application without restoring its state has zero effect on other apps. Other apps retain their state.
  • Tetsujin
    Tetsujin over 6 years
    @bames53 - I think you ought to provide this information as a separate answer - fully explaining how other apps would remain unaffected; because I'm not understanding your explanation & it serves no real purpose for us to thrash it out in comments.
  • bames53
    bames53 over 6 years
    @Tetsujin There's already an answer explaining it.
  • Tetsujin
    Tetsujin over 6 years
    There's an answer saying you can switch it off - it doesn't explain anything.
  • bames53
    bames53 over 6 years
    "hold down Shift ⇧ while opening any app to temporarily disable" Yep, this is the right way to do it.
  • BBaysinger
    BBaysinger almost 6 years
    This should be the accepted answer. Also, this default behavior in OS is dumb.
  • Clint Eastwood
    Clint Eastwood over 3 years
    the OP should mark this answer as the accepted one. Thanks a lot!