Home › Forums › General XMetaL Discussion › when will On_Document_After_DropText event be triggered? › Reply To: when will On_Document_After_DropText event be triggered?
Reply to: when will On_Document_After_DropText event be triggered?May 1, 2009 at 5:41 pm
The following macro inside journalist.mcr works for me in both XMetaL Author 5.1.1.017 and 184.108.40.206:
With this macro in place, pasting any text into the document results in that text being pasted followed by the string “PasteStringWithInterpret from inside On_Document_After_DropText”. Dragging and dropping text works as well (with or without the Ctrl key held down).
Perhaps you have some other scripts that are interfering or altering the standard behaviour, like the AcceptDropFormat API.
Note that On_Document_After_DropText should not fire if the paste operation fails (this would be the case if what is pasted would put the document into an invalid state). Depending on what you are trying to do you might want to use On_Document_Before_DropText instead to manipulate the content being pasted before it is pasted in. One use for this is to correct any invalid XML before it gets inserted.
Also note that these events do not run in PlainText view.