Controlling Saved Application States

When Lion was new, I put up a post about clearing out information on saved applications states. Saved application states are a new feature in Lion that remembers the screens that were open and where each was when you quit applications. The reason for that post was that those states were causing a few minor issues with applications. There are a few applications that the saving of application states is really awesome for. I think it will mostly be different for each persons workflow. Personally I like saving the state of Terminal, Safari and a few others. However, the state of some others can be a bit annoying for me. For example, Word. Luckily, you can control which applications have saved states and which do not. To do so, first find the application in ~/Library/Saved Application State. These usually are the bundleid of the application followed by .savedState. Using the bundleid (or whatever is listed if not the bundleid), you’ll then send a NSQuitAlwaysKeepWindows key to the defaults domain for that id with a boolean setting of true or false. For example, to disable the saved state for Microsoft Word: defaults write NSQuitAlwaysKeepsWindows -bool false To re-enable it, just send a true value into the same key: defaults write NSQuitAlwaysKeepsWindows -bool true
  • DB

    Have you found a defaults command to fully disable the Restart, Shutdown, Logout saved state check box?

    I hate that thing! I wrote an applescript app to help, but just a pain. It should be off by default and let you check it to enable it if you want it.

  • Pingback: lsregister: How Files Are Handled in Mac OS X |

  • Pingback: Automatic Application Termination & Servers |

  • Ilja Shebalin

    I realize this might be too old to be addressed to but since I’m on Lion then suddenly the Saved App State thing showed up before me, me using iWork’09 apps. Here’s the issue: when I open a document (not every though but MS Office suite) with any of these apps a window is usually being displayed with a warning of some errors. The annoying part is that despite having the box “Open when an error occurs” UNTICKED the window still pops up every time I launch the apps. Obviuosly it’s a bug, so would be nice to have some workaround to make it work as expected. My question’s does it have smth to do with SaveApplication State? If no, then is it possible to tweak with some system files to keep it intact?