Word won't stop opening all previous windows

Discussion in 'OS X Mountain Lion (10.8)' started by Laodah, Apr 7, 2013.

  1. macrumors newbie

    Joined:
    Feb 4, 2013
    #1
    I'm running Word 2011 in Mountain Lion 10.8.2. I've clicked the "close windows" box in General Prefs and unclicked the "annoy me to death" box in the shutdown warning dialogue. I've trolled the Word prefs for some box to unclick there, but haven't found it. I've thrown out the MS Saved Application State folder from /Library. Word is still reopening on launch all documents that were open when I shut down the computer.

    What am I missing?

    Thanks.
     
  2. macrumors 68020

    Joined:
    Jun 15, 2012
    #2
    For better or worse, Resume is here to stay, and most attempts to derail it don't always work, despite the myriad of webpages given over to it.

    The simplest method of stopping documents from re-opening is to swap the keystrokes for "Quit" (Command Q) and "Quit and Close Windows" (Command alt Q). Then when you hit Command Q, your apps will quit and close all windows.

    Of course, if you don't quit the app manually, it will come back on restart. The best method of combating this is an AppleScript that runs at shutdown which closes all windows of open apps and quits them before shutting down.
    I'm putting something together and will post it here later if I get a moment.
     
  3. thread starter macrumors newbie

    Joined:
    Feb 4, 2013
    #3
    Sigh. I hate Resume. And I haven't found many Maquistas online that don't. I'll be looking for your script post; this thing is driving me nuts.
     
  4. macrumors 68030

    Krazy Bill

    Joined:
    Dec 21, 2011
    #4
    In my Lion days there was a beta app called "noresume" but I can't find it anywhere. It allowed you to selectively chose which applications to ignore the resume/restore feature.

    I stopped using it when I just disabled my state folder for all applications - basically neutering this crap for all applications.

    http://forums.macrumors.com/showthread.php?t=1562191&highlight=disable+state
     
  5. Laodah, Apr 9, 2013
    Last edited: Apr 9, 2013

    thread starter macrumors newbie

    Joined:
    Feb 4, 2013
  6. macrumors 601

    Mr. Retrofire

    Joined:
    Mar 2, 2010
    Location:
    www.emiliana.cl
    #6
    Do you mean the RestoreMeNot preference pane?
     
  7. macrumors 68030

    Krazy Bill

    Joined:
    Dec 21, 2011
    #7
    Yes, that's it. No wonder googling for "NoRestore" go me nowhere. :)
     
  8. macrumors 68020

    Joined:
    Jun 15, 2012
    #8
    Here's what I've cobbled together from a couple of different scripts.
    It will close the windows and quit every app. It also lets you keep a "white list" of apps whose windows you don't want to close (funny, Resume has been default in Finder for decades :p); and of apps you want to quit, i.e. which won't launch again at restart.

    Code:
    -- Script to close all windows and quit all apps, then shutdown
    -- Based on scripts by Alex Layne and others
    
    tell application "System Events"
    	set the visible of every process to true
    	
    	set quit_white_list to {"Finder"}
    	-- Any apps in this list will not be quit.
    	
    	set close_white_list to {"Finder"}
    	-- Any apps in this list will not have their windows closed.
    	
    	try
    		set process_list to the name of every process whose visible is true
    		
    		repeat with i from 1 to (number of items in process_list)
    			set this_process to item i of the process_list
    			tell my application this_process
    				if this_process is not in close_white_list then close every window
    				if this_process is not in quit_white_list then quit
    			end tell
    		end repeat
    		
    	on error
    		tell the current application to display dialog "An error has occurred!" & return & "This script will now quit" buttons {"Quit"} default button 1 with icon 0
    	end try
    	shut down
    	
    end tell
    Running a script at Shutdown is trickier than I assumed, and there's no guarantee that the script will run before the OS has "ha ha quit" some or all apps.
    So you're best of getting in the habit of launching this instead of clicking shutdown.
     
  9. thread starter macrumors newbie

    Joined:
    Feb 4, 2013
    #9
    I may need to clarify my request: Word isn't opening on its own at computer restart. (Unclicking Resume-whatever stopped that.) What's happening is, when I launch Word after restart, it automatically opens all windows that were open when I shut down the computer. This only happens when I shut down the computer without quitting Word first. Which I usually do.

    I used to have the same problem with TextWrangler, but they soon posted an update that eliminated this bug.
     
  10. thread starter macrumors newbie

    Joined:
    Feb 4, 2013
    #10
    By the way, changing the permissions for the Saved Application State folder to "Read Only" seems to have worked! I just shut down with three Word windows open and restarted, and got no windows when I relaunched Word! Thanks again, Bill!
     
  11. macrumors regular

    Joined:
    Dec 23, 2012
    #11
    WTF is with the Resume hate? Normally I have 20 applications open, and sometimes I need to shut down OSX. It's really convenient to have these applications reopen in the same state when I restart. It happens quickly too, because I use a SSD.

    HINT: press Command+Option+W to close all windows before quitting the application! if you don't want them to come back next time.
     
  12. macrumors 601

    talmy

    Joined:
    Oct 26, 2009
    Location:
    Oregon
    #12
    Get out of the habit of using Cmd-Q to quit applications and use Cmd-W to close the window instead. It won't "resume" and you get the bonus of instant start up of the application since you haven't shut it down. Lion and Mountain Lion are designed to be used this way.
     
  13. macrumors 68030

    Krazy Bill

    Joined:
    Dec 21, 2011
    #13
    You are welcome. Just so you know, (and I'm sure you've learned by now), that change will affect every application, not just Word.

    Well, some of us just aren't you I guess.
     
  14. thread starter macrumors newbie

    Joined:
    Feb 4, 2013
    #14
    It's all good, Bill. To begin with, no other of my apps needs the intervention; they all turned off when asked. Word was the only one that wouldn't oblige. And I hate that "Resume" feature anyway. 'Bout the only time I'd welcome it is if I got a bomb and it offered it on restart, the way a browser says, "You shut down awful fast last time; you wanna open all the same windows you had open?"
     

Share This Page