Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 11 down vote accepted

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.

share|improve this answer
Excellent. Thank you. – Sean Whalen Mar 22 '13 at 2:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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