I would like to stop Mathematica from showing the "Save Changes To" dialog whenever I try to close a notebook. I tried changing this from the Option Inspector by setting the losingSaveDialog -> False However, for some reason, as soon as I then close the notebook, the dialog still pops up and when I double check, the Open Inspector seem to have changed back to default!? Is there a way for this to work as expected? I suppose that building a code for this should work, but I do not know how to do that...


1 Answer 1


After a bit of digging, one can adopt a similar code to here and do:

CurrentValue[$FrontEnd, "ClosingAutoSave"] = True

For some reason, this does not update the Option Inspector, but otherwise works.

Note: As @b3m2a1 pointed out, the above makes the change permanent, i.e. even exiting and re-entering Mathematica, the value of ClosingAutoSave will still be set on True. Instead:

 CurrentValue[$FrontEndSession, "ClosingAutoSave"] = True

will only change the setting for the current session.

  • 1
    $\begingroup$ Probably safer to do it on $FrontEndSession instead of $FrontEnd. Doesn't make the changes permanent $\endgroup$
    – b3m2a1
    Mar 7, 2019 at 20:16
  • $\begingroup$ thanks, I updated the answer $\endgroup$
    – Patrick.B
    Mar 8, 2019 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.