Copy link to clipboard
Copied
Hi,
I have a ScriptUI I made earlier. There is an important structure in which EditText is triggered by the onEnterKey event, but since CC, this EditText has been deactivated after the event. I want to keep this EditText active.
This problem could not be solved by using onChange, onDeactivate.
Is there any effective way?
On Mac.
... I know that in the not too distant future, this will have to be redeveloped with CEP (or UXP?).
regards, regards.. I am very frustrated and in trouble.
Copy link to clipboard
Copied
For making edittext active you just need this:
edittextBox.active = true;
Can you share your code where you are stuck?
Copy link to clipboard
Copied
hi Sunil, this is simple code to test.
try to run it on InDesign. I use CC2019.
#target indesign
#targetengine "test"
var a = new Window("""palette{text:"test",
E:EditText{characters:10, text:"test me"}}""");
a.E.onEnterKey = function(){
$.writeln(this.text);
}
a.show();
I wish E keep active, but it never.
This problem does not occur on ESTK.
I found that I could keep it active with shift + enter, but I also found that the event was executed 5 times ...
Have some idea?
Copy link to clipboard
Copied
Even if I was active in the event like this, I am seriously worried that it will be deactive when I leave the event.
var a = new Window("""palette{text:"test",
E:EditText{characters:10, text:"test me"}}""");
a.E.onEnterKey = function(){
$.writeln(this.text);
this.active = true; // added line
}
a.show();
thanks.