-1

I am desperately trying to find out wether there is a way to assign and execute a custom function with javascript to a button and its action in Adobe inDesign like it is in Adobe Acrobat? If anyone could help me with this it be very much appreciated.

1 Answers1

0

try the following code snippet

var wnd = new Window("dialog");
var editBox = wnd.add("edittext", undefined, "SoMeText");
var button = wnd.add("button", undefined, "UpperCase");
button.onClick = function() {
    editBox.text = editBox.text.toUpperCase();
    // Add your functionality in this block here.
}

If you are looking for something like event listeners, you can do that as well using addEventListener(), notify(),removeEventListener(). Here is a small documentation of those. enter image description here