Skip to main content
August 18, 2009
Answered

scriptui palette window

  • August 18, 2009
  • 1 reply
  • 6146 views

hi everyone!

for an indesign script I want to have a palette window with sliders to be able to change certain values and instantly observe the results. but right at the start I ran into trouble.

a simple script like

var window = new Window("palette", "title");
var result = window.show();

will work in the extendscript ide or in bridge, but not in indesign! (all cs3, windows)

a normal dialog window works though.

I think the documentation somewhere mentions that photoshop doesn't support palette windows, but nothing is said about indesign -- that's why I assumed that it should actually work.

any ideas?

thanks!

w

This topic has been closed for replies.
Correct answer Bob Stucky

InDesign (like Photoshop) runs every script in a new scripting engine. When the script is done executing, the scripting engine goes away. So if you're showing a palette, it goes away too (very quickly). If you're showing a modal dialog, the script hasn't completed, and the dialog remains.

To show a palette, you have to run it from a persistent, named scripting engine. You create one of those using the #targetengine directive in your script. Even then, the to run it from the ESTK, the engine must already exist. You can place a small script in a folder named "startup scripts" underneath the Scripts folder for InDesign. When ID starts, it looks for all jsx files contained in folders named "startup scripts" underneath "Scripts" (and it's a hierarchical search - it will look downline in all folders) and runs them, creating persistent scripting engines for all those that have the targetengine directive.

In PS, you can't create a persistent engine yourself. Meanwhile, PS does have 1 persistent engine for BridgeTalk, so you can send a BT message to PS to request it to open a palette.

Bob

1 reply

Bob Stucky
Adobe Employee
Bob StuckyCorrect answer
Adobe Employee
August 18, 2009

InDesign (like Photoshop) runs every script in a new scripting engine. When the script is done executing, the scripting engine goes away. So if you're showing a palette, it goes away too (very quickly). If you're showing a modal dialog, the script hasn't completed, and the dialog remains.

To show a palette, you have to run it from a persistent, named scripting engine. You create one of those using the #targetengine directive in your script. Even then, the to run it from the ESTK, the engine must already exist. You can place a small script in a folder named "startup scripts" underneath the Scripts folder for InDesign. When ID starts, it looks for all jsx files contained in folders named "startup scripts" underneath "Scripts" (and it's a hierarchical search - it will look downline in all folders) and runs them, creating persistent scripting engines for all those that have the targetengine directive.

In PS, you can't create a persistent engine yourself. Meanwhile, PS does have 1 persistent engine for BridgeTalk, so you can send a BT message to PS to request it to open a palette.

Bob

August 19, 2009

works (so far). -- thanks a lot!

Bob Stucky
Adobe Employee
Adobe Employee
August 19, 2009

LOL -

Oh, it'll work alright. I've done some crazy stuff with ScriptUI. It can be a bit verbose to code; but, it's pretty solid. If you run into a problem, post away. I'll give you as much help as I can.

Bob