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$

1 Answer 1

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$
1
  • $\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.