Managing Mac OS X Lion's application resume feature

OS X Lion comes with a feature that automatically resumes the last state of applications, including previously opened documents and windows. Here is how to manage and customize this behavior.

One of the new features in OS X Lion is the application resume option, where the system will remember the documents, windows, and positioning of applications when they are quit, so when you open them again you will be right where you left off. This option is convenient for many purposes; however, there may be some situations where it may not be desired. For instance, if an opened document causes a program to crash, then having it reopen immediately when the application is launched might result in the program continuing to crash. Additionally, there might be some security or privacy concerns where if a program is terminated with a document open that contains sensitive data, then that document may be immediately opened again just by relaunching the program.

Luckily, there are several methods you can use to manage the resume feature, and by doing so can customize its behavior to do anything from disabling resume, to opening a specific window set each time the program is opened.

OS X Lion Saved States
Saved States are saved on a per-application basis in the user's Library folder.

Lion's resume feature works by saving information about each window in a database in your home directory, which is located in the /username/Library/Saved Application State/ folder. The system will create a subfolder within this directory for each application you open on the system, and will then continuously update the contents of these folders as you create windows, move and resize them, and otherwise use your program. When a program is opened, the system will identify it and determine if a saved state is present, and then open those specific windows again. After using Lion for a while you will see a number of saved application states begin to populate this folder.

Option-quitting programs
Holding the Option key when quitting will discard the application's saved state.

The first and foremost option is the one that Apple has built into the system, which is the option to quit a program without saving its resume state. To do this, just quit the program while holding down the Option key, either by pressing Option-Command-Q, or by pressing the Option key when selecting "Quit" from the application menu. When you do this, the standard "Quit" function will change to "Quit and Discard Windows," which will delete the saved window state when the program is quit. When you next launch the program, a new saved state will be created for it that will track your window behaviors for the next time the program is quit.

This feature is convenient, because it tells us that the save state feature is dependent solely on the presence of the files and folders in the "Saved Application State" directory. Therefore, by manipulating the contents in this directory you can further customize the saved state behavior without harming the system or your applications. Here are some options:

  1. Turn off the Resume feature in OS X

    Locking folders in the Finder
    Clicking the "Locked" check box will prevent the Saved Application State folder from being modified. You can also do this for individual application saved state folders.

    If you do not want the Resume feature to run at all for any application you use, then you have two options. The first is to turn it off in the "General" system preferences by unchecking the "Restore windows when quitting and re-opening apps" option. The second is to get information on the /username/Library/Saved Application State/ folder and click the "Locked" check box. This will prevent the folder from being modified, and will therefore prevent any new saved states from being placed in the folder by the system when you run your applications. With the system preferences disabled, if you hold the Option key when quitting the application, it will reverse the behavior and enable the restore feature for that application (Thanks to MacFixIt reader "Jean-Pierre" for this tip).

  2. Turn off the Resume feature for a specific application

    As with locking the entire Saved Application State directory, you can also lock individual saved state folders contained within it, which will prevent that one application from making modifications to the directory. If you open an application and then quit it, go to the Saved Application State folder and locate the saved state for your application. Then delete its contents and lock it, and from then on that application will no longer reload any windows when it is opened.

  3. Create a launch template

    A slight modification to disabling Resume for a specific application is to create a template for it. If you want certain windows and documents to open to a specific location whenever you launch an application, then open that application and set up your windows accordingly. Then quit it, locate its saved state, and lock the folder in the Finder. From then on the program will open with those specific documents and window positions, even if you change them and then quit the program.

  4. Manually reset an application's saved state

    A final option is to discard the saved state of an application after you have quit it. While you can use the Option key when quitting to discard the saved state, if you forgot to do this then you can still delete the saved state by going to the Saved Application State folder and either removing the contents of the saved state folder for the application, or the folder itself.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

Tags:
Computers
About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    ARTICLE DISCUSSION

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    Hot on CNET

    The Next Big Thing

    Consoles go wide and far beyond gaming with power and realism.