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

UI Window type "Palette" and "Window" not working in InDesign 2020

Participant ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Hi,

 

Samplae code:

var palette = new Window("palette");
palette.text = "Dialog";
palette.orientation = "column";
palette.alignChildren = ["center","top"];
palette.spacing = 10;
palette.margins = 16;
// PANEL1
// ======
var panel1 = palette.add("panel", undefined, undefined, {name: "panel1"});
panel1.text = "Panel";
panel1.orientation = "column";
panel1.alignChildren = ["left","top"];
panel1.spacing = 10;
panel1.margins = 10;

var statictext1 = panel1.add("statictext", undefined, undefined, {name: "statictext1"});
statictext1.text = "StaticText";
var edittext1 = panel1.add('edittext {properties: {name: "edittext1"}}');
edittext1.text = "EditText";
palette.show();


I try to execute the code above in InDesign 2020, the UI palette does not appear, and then using the dialog its works fine.

can anyone kindly explain why window type palette not working?
TOPICS
Scripting

Views

323

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

correct answers 1 Correct answer

Contributor , Mar 11, 2021 Mar 11, 2021

Hi,

for palettes you need a persistent engine / targetengine

#targetengine "myPalette"

var palette = new Window("palette");
palette.text = "Dialog";
palette.orientation = "column";
palette.alignChildren = ["center","top"];
palette.spacing = 10;
palette.margins = 16;
// PANEL1
// ======
var panel1 = palette.add("panel", undefined, undefined, {name: "panel1"});
panel1.text = "Panel";
panel1.orientation = "column";
panel1.alignChildren = ["left","top"];
panel1.spacing = 10;
panel1.margins = 10;

var
...

Votes

Translate

Translate
Community Expert ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Hi Balaji Murugesan,

just tested your code successfully with my German version of InDesign 15.1.3.302:

 

ScriptUI-Window-Dialog-InDesign-2020.PNG

 

What's your operating system?

 

Regards,
Uwe Laubender

( ACP )

 

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
Participant ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

MacOs Mojave

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 ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Hm. I'm on WIndows 10.

 

Regards,
Uwe Laubender

( ACP )

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
Participant ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

There is any possible way availabe to use in mac?

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
Contributor ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

LATEST

Hi,

for palettes you need a persistent engine / targetengine

#targetengine "myPalette"

var palette = new Window("palette");
palette.text = "Dialog";
palette.orientation = "column";
palette.alignChildren = ["center","top"];
palette.spacing = 10;
palette.margins = 16;
// PANEL1
// ======
var panel1 = palette.add("panel", undefined, undefined, {name: "panel1"});
panel1.text = "Panel";
panel1.orientation = "column";
panel1.alignChildren = ["left","top"];
panel1.spacing = 10;
panel1.margins = 10;

var statictext1 = panel1.add("statictext", undefined, undefined, {name: "statictext1"});
statictext1.text = "StaticText";
var edittext1 = panel1.add('edittext {properties: {name: "edittext1"}}');
edittext1.text = "EditText";
palette.show();

 

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