Highlighted

How to keep EditText active after an event on CC

Enthusiast ,
Oct 27, 2020

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.

TOPICS
Scripting

Views

132

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to keep EditText active after an event on CC

Enthusiast ,
Oct 27, 2020

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.

TOPICS
Scripting

Views

133

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 27, 2020 0
Adobe Community Professional ,
Oct 27, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2020 0
Enthusiast ,
Oct 27, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2020 0
ajabon LATEST
Enthusiast ,
Oct 27, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2020 0