Skip to main content
Vamitul - ks
Inspiring
Apr 22, 2026 5:13 AM UTC
Question

New Event Types in the scripting DOM?

I'm slowly working on building proper TypeScript definitions for InDesign, and while trawling through the Object Model I noticed InDesign 2026 has two new event types: `BEFORE_SCRIPT_METHOD` and `AFTER_SCRIPT_METHOD`.

Can anyone shed some light on them?

    4 replies

    rob day
    Community Expert
    Community Expert
    Apr 22, 2026 2:08 PM UTC

    Sorry, I’m actually using ID 2025, which is probably the reason for the error—although the indesignjs.de API is not including it in their reference.

     

    I can only guess that calling a public function would trigger my scriptMethod() event function?

    Translate
    rob day
    Community Expert
    Community Expert
    Apr 22, 2026 2:01 PM UTC

    If I try to ad an afterScriptMethod listener, Visual Studio Code throws a not a recognized event type error:

     

    #targetengine "session";

    app.addEventListener("afterScriptMethod", scriptMethod);

    function scriptMethod(e) {
    alert("Event Object is: " + e.parent.constructor.name)
    };

     

     

     

    Translate
    Vamitul - ks
    Inspiring
    Apr 22, 2026 12:04 PM UTC

    Hi ​@rob day 

    It's both UXP and ExtendScript, I found them diffing the OMV XMLs. It looks to be new in 21.3 (lovely when the DOM changes between major releases, no?)

     

    Translate
    Krommatine Systems: InDesign plugins, tools, and automations.
    rob day
    Community Expert
    Community Expert
    Apr 22, 2026 11:59 AM UTC

    Hi ​@Vamitul - ks , Could you clarify if this for ExendScript or UXP? I’m not seeing it in the ExtendScript Event lists

     

     

     

    Translate