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

Community Beginner ,
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

66

Likes

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...

Likes

Translate

Translate
Adobe Community Professional ,
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 )

 

Likes

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

Copy link to clipboard

Copied

MacOs Mojave

Likes

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

Copy link to clipboard

Copied

Hm. I'm on WIndows 10.

 

Regards,
Uwe Laubender

( ACP )

Likes

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

Copy link to clipboard

Copied

There is any possible way availabe to use in mac?

Likes

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();

 

Likes

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