function myDocumentSaveHandler() { alert("Some document was Saved!"); } Application.onNewDocument = myDocumentSaveHandler;