13
$\begingroup$

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

$\endgroup$
12
$\begingroup$

You can use NotebookEventActions for this. For example, evaluating

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

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

$\endgroup$
  • $\begingroup$ Excellent. Thank you. $\endgroup$ – Sean Whalen Mar 22 '13 at 2:13

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.