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.
Asked
Active
Viewed 684 times
1 Answers
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.

Manish Jangir
- 48
- 4
-
thanks for your fast reply and good help. It got me further down the line. – naishblue Jul 04 '18 at 16:54