General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion when will On_Document_After_DropText event be triggered?

  • lqian

    when will On_Document_After_DropText event be triggered?

    Participants 0
    Replies 1
    Last Activity 13 years, 5 months ago

    Dear all,

    Could anybody please tell me when On_Document_After_DropText event will be triggered?

    I need to assign new Id for the pasted node(s) if the Id already existed in the document. My application uses range.PasteStringWithInterpret method to paste the content into the document from its own cache which contains the clipboard content.

    It seems PasteStringWithInterpret  not triggered the On_Document_After_DropText event, or  I missed out something.

    Regards,

    Ling

    Reply

    Derek Read

    Reply to: when will On_Document_After_DropText event be triggered?

    The following macro inside journalist.mcr works for me in both XMetaL Author 5.1.1.017 and 5.5.0.219:

    [code][/code]

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support