I know that $Epilog is called when Mathematica is exited; is there a callback upon exiting the notebook? If so, what is it?


1 Answer 1


You can use NotebookEventActions for this. For example, evaluating

    NotebookEventActions -> {"WindowClose" :> CreateDocument[]}];

in your current notebook will open a new one when you close (or try to close) the window.

  • $\begingroup$ Excellent. Thank you. $\endgroup$ Mar 22, 2013 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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