Copy link to clipboard
Copied
There seems to be a new ScriptUI bug in InDesign 2021 on Windows.
If you create a window with an EditText widget, and set the EditText to be active (which is theoretically supposed to give it the keyboard focus) it becomes impossible to type anything in it.
Ironically, not setting it to "active" is okay.
Here's a test script:
testWindow();
function testWindow(){
var x,w;
w = new Window("dialog", "Type something...");
x = w.add("editText");
x.characters = 20;
x.active = true;
w.show();
}
If this is run on Windows 10 with InDesign 2021 I'm not managing to type anything into the text field.
But changing x.active to "false", or commenting out that line, fixes the problem (although the text field then does not have the keyboard focus, of course).
Seems to be ok on MacOS. And InDesign 2020 on Windows.
Can anyone confirm?
Thanks,
Ariel
Copy link to clipboard
Copied
Hi Ariel, Your sample script worked for me on ID 16.1 x64 on Windows 10. The box had active focus upon execution and I was able to type into it. If it matters, I ran it through the Script panel, not the Toolkit or VS Code.
Copy link to clipboard
Copied
Hmm. Just tried it myself again after restarting InDesign, and as you say, it seems to work ok. However, this has happened intermittently for a while now, so I guess I still need to figure out what triggers it. It's not quite as simple as I had hoped!
Thanks for the feedback!
Ariel
Copy link to clipboard
Copied
It works for me as expected: no problem occurs when run both from ESTK and the scripts panel.
Windows 10 (version 1909), InDesign 16.1 x64.
— Kas
Copy link to clipboard
Copied
Hi Ariel,
Works fine here: ID 16.1.x64 / Win 10 Pro 1909.
Copy link to clipboard
Copied
Hi Ariel,
tested your code with:
German InDesign 2021 version 16.1.0.20
Windows 10 Pro 2004
No issues.
More details on Prerelease.
All fine also there.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thanks Uwe!