Copy link to clipboard
Copied
Dear all,
I want to do something with the content of an edittext area - namely for onClick and for onDoubleClick. As you might know, these events are not triggered in edittext - but for example in a listbox. Hence I try to set up specific event handlers. But nothing happens when clicking/double clicking on the edit field.
→ What is missed here?
/* on(Double)Click.jsx ====== UTF-8 ====================================
check possibilites to act on an edittext click/doubleclick
Comment There is no onClick (and no onDoubleClick) for edittext
Hence appropriate event listeners must be defined
See JavaScript Tools Guide for the eventName in
controlObj.addEventListener (eventName, handler[, capturePhase]);
Reference https://stackoverflow.com/questions/39416360/set-focus-of-edit-text-in-extendscript
History 2020-10-25
*/ ; // =========================================================================
main = function () {
var win;
win = new Window ("dialog", "on(Double)click", undefined, undefined);
win.eField = win.add ("edittext", undefined, "Text in field", undefined);
win.btnCancel = win.add ("button", undefined, "Cancel", undefined);
//win.eField.active = true;
win.eField.addEventListener ("click (detail = 1)", hClick); //, true);
win.eField.addEventListener ("click (detail = 2)", hDClick); //, true);
win.show ();
} //--- end main
hClick = function () {
alert ("Click into edittext");
$.writeln ("Click into edittext");
} //--- end hClick
hDClick = function () {
alert ("DoubleClick into edittext");
$.writeln ("DoubleClick into edittext");
} //--- end hDClick
main ();
Hi Klaus, I don't have time to look at this now, but you may want to post this to the InDesign forum. There are some seasoned ScriptUI users on there that have helped me from time-to-time with these kinds of issues. They are not specific to FrameMaker and the InDesign community is much larger than the FrameMaker community.
Here is a useful, free resource for the ScriptUI object:
Copy link to clipboard
Copied
Hi Klaus, I don't have time to look at this now, but you may want to post this to the InDesign forum. There are some seasoned ScriptUI users on there that have helped me from time-to-time with these kinds of issues. They are not specific to FrameMaker and the InDesign community is much larger than the FrameMaker community.
Here is a useful, free resource for the ScriptUI object:
Copy link to clipboard
Copied
Thank you Rick for the tip (ID-forum). The pdf from Petr Kahrel is my main source four ScriptUI problems...
Copy link to clipboard
Copied
See https://community.adobe.com/t5/indesign/eventlistener-not-working-for-edittext/td-p/11543690 for the answer from Peter Kahrel.
Copy link to clipboard
Copied
After all I do not implement something special:
After all these are common actions.