• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to keep EditText active after an event on CC

Community Expert ,
Oct 27, 2020 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

404

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
community guidelines
Advocate ,
Oct 27, 2020 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?

Votes

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
community guidelines
Community Expert ,
Oct 27, 2020 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?

Votes

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
community guidelines
Community Expert ,
Oct 27, 2020 Oct 27, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines