Why does InDesign lose all keyboard ability if a scriptUI palette is open?

906 views Asked by At

Salvete! I have a simple InDesign script to display a palette window. Problem is, when I display this window, or any other scriptui palette, InDesign loses all keyboard focus - I just can't type anything. It's as if the script palette eats all my keyboard input.

Here is the most simple script:

#targetengine session;    //I have tried without this line, too.
var PaletteWindow = new Window('palette', "Test");
PaletteWindow.show();

Am I missing something? Has anyone else seen this problem? I am using InDesign CS4 on XP Pro SP3; Dell Precision T3400 with Core Duo; 4mb of RAM.

Here is the link to my post at InDesignSecrets: http://indesignsecrets.com/forum/indesign-add-ons-scripts-scripting-and-plug-ins/scriptui-palette-breaks-keyboard#p8419

1

There are 1 answers

0
bgmCoder On BEST ANSWER

Ah, I figured I could answer my own question after four months. This link is to a thread with the same problem where the palettes steal keyboard focus. It does not contain a definitive solution, but does offer a workaround:

http://forums.adobe.com/thread/288782?start=0&tstart=0

Here is another workaround: Since the palette is supposed to "do something" and then return focus to IND, then add:

app.activate();

to the function call for the button. That way, after you push the button, you can work normally in IND.

This works fine, except that anytime you move the mouse over the palette, it sets focus to the application. This solution is a workaround for CS4.

[update] Now I am using CS5, and I find that it is no longer necessary to do this. It seems the problem was a bug in the CS4 UI scripting interface.