How to Enable or Disable JavaScript in Safari: Choose your Poison
APWG Web Vulnerabilities Report, Act II

How to re-open documents and windows when you re-open applications: OS X Lion and Mountain Lion

Some users prefer to have their applications open whatever documents or windows they left open when they last closed that application. Users who want to pick up where they left off in this manner will find that setting preferences to enable this behavior changes when they migrate from OS X Lion to OS X Mountain Lion.

First let's see how you do this. Then we'll discuss whether it's wise.

OS X Lion: Restore Windows when quitting and re-opening apps

Open System Preferences in OS X Lion.  

Click the Show All button.

Click the General icon.

Check the box labeled Restore Windows when quitting and re-opening apps if you want to re-open all windows or documents when you re-launch applications.


OS X Mountain Lion: Close Windows when quitting an application

Open System Preferences in OS X Mountain Lion.  

Click the Show All button.

Click the General icon.

(Pay attention to the negative logic here)

Uncheck the box labeled Close Windows when quitting an application if you want to re-open all windows or documents when you re-launch applications.



Re-opening documents or windows may not be a good idea

When you takes advantage of this convenience feature, you run the risk of  re-visiting a malicious hyperlink, page, or document.  Users can end up in a closed loop of mischief of this kind:

  • You open a browser, visit a web page
  • A script on that page executes and some badness wrecks havoc on your Mac
  • You quit the browser
  • You discover and undo (remediate) the harm
  • You re-launch the browser (a.k.a., lather-rinse-repeat)

By enabling this preference, you're permitting not only your browser but all applications to re-open the last or recent document or window. If you use MS Office, for example, you may re-open a Word document containing a nasty macro that arrived as an attachment, or a malicious PDF or Flash file with an Adobe product.

Before you enable this behavior, ask whether you want to open whatever you last opened, a favorite site, or (the safest course) start anew. Then explore whether you can accomplish what you want without the broad and potentially nefarious "allow any" preference. It's unfortunate that convenience features can put your Mac at risk, but now that you're aware, choose wisely.

(Note: Certain browsers have similar options or addons. Firefox, for example, has Show my windows and tabs from last time under General -> Home Page. Safari has SafariRestore. Explore other applications you use frequently  understand how they behave when opened.)


Feed You can follow this conversation by subscribing to the comment feed for this post.

From all the documentation I find, these settings are hidden from the Mountain Lion UI.

There is an addon, Deeper for Mountain Lion 1.6.5, that claims to "enable and disable the hidden functions of Finder, Dock, Dashboard, Exposé, Safari, Login window and many other of Apple's applications". I have not tried it but you can read about it at

If you know OpenBSD well, it may be possible to make the same changes to hidden settings that Deeper makes via a Terminal window (assuming you have sudo privileges). I haven't found where Recent Items settings are located yet, but will hunt around.

In OS X Lion's System Preferences one was able to set different values for the number of recent applications, documents and servers to show in the Apple menu, respectively. In the same preference panel in OS X Mountain Lion this is no longer possible – one can only set a fixed number of apps, docs and servers to show, say 10 each, regardless of type.

If wonder if there is any workaround for this behavior in Mountain Lion, so that I can set the menu to show, say 5 recent applications, 10 recent documents and 0 recent servers – i.e. in the same way one could do in Lion?

The comments to this entry are closed.