exec_command and exec_command_* event
The exec_command_* event fires whenever an ExecCommand is executed.
A specific event such as exec_command_newdoc fires when that individual command runs.
Syntax
function(state,cmd,value)
Example usage
editor1.attachEvent("exec_command_newdoc", function (state, cmd, value) {
state.returnValue = true;//handled, don't execute default action
this.setHTMLCode("<p>NewDoc...</p>");
});