I’ve been having this problem in Lion, and the only workaround I’ve found is to disable Resume, on a once-off or total basis for Preview.
Disabling Resume permanently
If you open Terminal (/Applications/Utilities/Terminal.app
), and enter the following string, then Resume for Preview will be disabled permanently:
defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false
You can also disable Resume for all apps in System Preferences: in the General
pane, untick the checkbox marked Restore windows when opening and quitting apps
. I find Resume generally useful, so I haven’t, but you might want to do this.
One-off disabling or Resume
If you don’t switch it off permanently, and you’re working with a lot of files in Preview, you might not want it to re-open them the next time you launch it. When you quit Preview, hold down the option
key; then the Quit Preview
command becomes Quit and Discard Windows
. Use this, and it won’t reopen all of your files next time. (Keyboard shortcut is opt-cmd-Q
).
If you forget to do this when you close Preview, and it starts hanging, then you can flush the Resume data. Navigate to ~/Library/Saved Application State/com.apple.Preview.savedState
and delete the file or folder stored there. This deletes all the saved data for Preview, so when you open Preview later, it doesn’t restore any of your saved documents.
This is probably more useful if it’s misbehaving intermittently, than for the problem you describe.
Further comments
If you’ve set Preview to never remember your files, you can temporarily get it to remember them. As with the one-off disable, hold down the option
key when you quit Preview, then you get the command Quit and Keep Windows
.
I disabled Resume for Preview shortly after Lion came out, and I’ve not had any problems since. However, I only use Preview for images, not PDFs (I use TeXShop for that), but even so, the hanging is completely gone.
You can also have “opt-in” Resume using these steps. If you disable Resume for all apps, then run the Terminal command above with true
instead of false
, then you can whitelist Resume-enabled apps, rather than blacklist them. You can find the com.apple.Preview
equivalent for any app by looking at what the appropriate file is called in the Saved Application State
folder. (A quick Google search for Terminal commands involving that app
would also do the trick).
I hope some of this is useful and speeds up Preview: it certainly worked for me.
One of two things has happened to make Mail non-responsive during the normal quit process.
- The entire program has hung (and you will see it as non-responsive in Activity Monitor or the Force Quit dialog window).
- Mail's background threads for interacting with mail servers have hung and not timed out (and you can open the Activity Window from Mail's Window Menu) to see what specific account and perhaps even what it's trying to do (such as delete messages, send mail, update or synchronize a folder, etc…)
Once the quit menu is dim - you can either force quit the app, wait for it ti finish quitting or log out of that user (perhaps by rebooting) but you can be sure the Mail program is trying to quit at this point so you can continue to use it or decide to help it down as you see fit.
Best Answer
Don't use Alfred myself so I can't give a specific answer.
Something I would try though is using
opensnoop
to see if I can work out where it is failing.If you type
sudo opensnoop | grep alfred
into a Terminal it'll show you all the files that Alfred is touching. That might help you identify where it is crashing, for example if it is a corrupt plist file.