How to completely disable auto-save and versions in Mac OS X Lion? I hate the automatic saving and versioning in Mac OS X Lion.

Is there a way to completely turn it off?

(This has been asked before here, but the answer and the linked article are completely wrong, so I thought I'd try again.)
I intentionally was searcing for hidden defaults1 and fortuitously stumbled across a defaults setting that disables Auto Save, Versions and Resume, all at once. 

If you have a tolerance for potentially breaking things (joke), try the following Terminal command (for Preview in this example):

defaults write -app 'preview' ApplePersistence -bool no


Replace preview with the name of whatever app you wish to perform this on.

Alternatively, you can configure this globally with this command (but beware that this causes slow logins, so not recommended):

defaults write -g ApplePersistence -bool no


I can confirm that this works for TextEdit, Preview, Automator and Safari (for disabling Resume), but it should also work for other Apple applications like iWork, Xcode, iPhoto etc. It also works for some, but not all, third party applications. My machine hasn't gone up in flames (joking again) but as long as you have a good backup system, these settings seem stable to change and test. 

For TextEdit, you must additionally run the following command, in order to avoid sandbox errors:

defaults write -app textedit AutosavingDelay -int 0


[This effectively disables the old-style, pre-Lion autosaving completely, so the sandbox won't complain anymore about TextEdit trying to automatically save stuff without your "consent".]

Another option, is a TextEdit fork called "TextEdit+", that thankfully isn't sandboxed (surprisingly, TextEdit is actually open source). It can be downloaded here.

Disabling ApplePersistence also restores Save As in most apps, except in Preview, iWork and maybe some others. In those cases you can use the Export… menu item instead. This is almost identical to Save As, except that you have to manually open the document after saving it. Just assign Command-Shift-S to Export… in these applications, and you'll get something very similar to Save As there too.

To restore normal behaviour, run:

defaults delete -app 'preview' ApplePersistence

defaults delete -g ApplePersistence

defaults delete -app textedit AutosavingDelay




1 Thanks to Lri for his excellent one-liner for finding hidden defaults settings.