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

scriptui palette window

Guest
Aug 18, 2009 Aug 18, 2009

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

TOPICS
Scripting
6.3K
Translate
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

correct answers 1 Correct answer

Adobe Employee , Aug 18, 2009 Aug 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

...
Translate
Adobe Employee ,
Aug 18, 2009 Aug 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

Translate
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
Guest
Aug 19, 2009 Aug 19, 2009

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

Translate
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
Adobe Employee ,
Aug 19, 2009 Aug 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

Translate
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 Beginner ,
Aug 22, 2009 Aug 22, 2009

Bob,

#targetengine "session"

lets me create a palette without having to create a named scripting engine of my own.

Am I correct in understanding that this uses the existing InDesign session?

Steve Caine

Translate
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
Adobe Employee ,
Aug 23, 2009 Aug 23, 2009

You are correct, ID does have an engine named "session". I don't recommend doing using it though. If you consider what could happen if a user had 10 scripts written for the session engine, you could run into unexpected trouble. The "session" engine has (just like any other engine) a single global namespace. If two scripts get loaded into that engine which have identically named functions, running the second script will replace the first script's version of the function.

The safest way to go is to always create your own engine.

Bob

---

Translate
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 Beginner ,
Aug 24, 2009 Aug 24, 2009
LATEST

OK, thanks for the insight. It's valuable information.

Steve

Translate
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