Friday, July 22, 2011

Turn Off Lion OS X Restore For Individual Apps

Apple OS X Lion is out and a (mostly) huge hit among early adopters. One feature though that some users are not happy with is Restore, which opens windows and websites that were open when an App was last closed. This is a great feature for most users, but some users either prefer a fresh slate when they open an App or do not want their browser to re-open the last websites they were visiting.

There is an easy fix.

You could just turn off Restore in the System Preferences, under the General section. Simply uncheck the box that says, "Restore Windows when quitting and re-opening apps." That will keep Lion from doing that with every app.


If you like Restore and only want to tell it to stop working on specific apps, you can use a Terminal command to stop this on any specific app.

A Mac Life article has the how to:

"First you’ll need to know exactly which app you want to kill this feature on -- we’ll use Preview as an example, since it may not be desirable to have it restore documents in most cases. Fire up Terminal again and use the following command without quotes: “defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -int 0”. For other applications, simply replace “Preview” with the name of the app -- when in doubt, visit your Preferences folder to confirm how the app name appears in the “com.apple.XXXX” file this is modifying."

---

To see the exact way an app name appears (i.e. if Apple refers to the app in an uppercase letter or not), make sure the Finder is selected so the Finder menu appears, then up left near the Apple logo on the desktop bar click Go To, then Go To Folder, and type in ~/Library. Then in the window that opens, click on Preferences. You'll see a list of files, don't click on any. Just scroll down to the com.apple.XXXX area to see how the app you want to change appears. In this case, Safari is what one would expect, Safari with a capitol S.

So the command to type or copy and paste into Terminal for Safari is (without the quotation marks):

"defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -int 0"

Then hit enter.

Close and restart Safari, next time you restart the computer Safari (or whatever other App(s) you ran that on) should not resume automatically from the last saved state.

2 comments:

Anonymous said...

Can't get this to work for Mail--any suggestions? I've tried using "mail" "mail.plist" "applemail" and "applemail.plist" where you have "Safari" but it doesn't work. Mail still launches and opens windows that were open on quit.

Dean Dooley said...

I'm not sure if you can stop Mail from restoring itself.

You could try installing Lion Tweaks, which makes turning off individual apps in Restore simple, then try and turn off Mail using Lion Tweaks....


http://www.macupdate.com/app/mac/39654/lion-tweaks

Once installed, on the right column click on "Disable Resume For A Single App", then enter com.apple.mail.plist and see if it works.