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
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.