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

Features of ScpiptUI behavior in different applications

Engaged ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

There are a few questions about UI scripts.
I hope that someone will explain to me some of the behavior and writing scripts of this type.

1. Studied ScpiptUI, took examples from the article
https://community.adobe.com/t5/illustrator-discussions/scriptui-how-to-update-listbox-values-cc2014/...
,launched the script in Photoshop.
It is not executed, the application window of this script does not open.
Changed the runtime to Illustrator, the script runs fine.
With what it can be connected?
It is clear that the script is written for Illustrator, but what's the difference?
Why doesn't it run in Photoshop? There is no article on this topic in the reference material.

The following script also runs only in the Illustrator environment
------------------------------------------------------------------------------------------------
// PALETTE
// =======
var palette = new Window("palette", undefined, undefined, {closeButton: false});
palette.text = "Layer Devide";
palette.orientation = "column";
palette.alignChildren = ["fill","top"];
palette.spacing = 18;
palette.margins = 10;

// PANEL1
// ======
var panel1 = palette.add("panel", undefined, undefined, {name: "panel1"});
panel1.text = "Layers";
panel1.orientation = "column";
panel1.alignChildren = ["left","top"];
panel1.spacing = 18;
panel1.margins = 16;

// GROUP1
// ======
var group1 = panel1.add("group", undefined, {name: "group1"});
group1.orientation = "row";
group1.alignChildren = ["center","center"];
group1.spacing = 30;
group1.margins = 6;

// L_NAME
// ======
var L_name = group1.add("group", undefined, {name: "L_name"});
L_name.enabled = false;
L_name.orientation = "column";
L_name.alignChildren = ["center","center"];
L_name.spacing = 10;
L_name.margins = 1;

var statictext1 = L_name.add("statictext", undefined, undefined, {name: "statictext1"});

var statictext2 = L_name.add("statictext", undefined, undefined, {name: "statictext2"});
statictext2.text = "A";

var statictext3 = L_name.add("statictext", undefined, undefined, {name: "statictext3"});
statictext3.text = "B";

var statictext4 = L_name.add("statictext", undefined, undefined, {name: "statictext4"});
statictext4.text = "C";

// GROUP2
// ======
var group2 = group1.add("group", undefined, {name: "group2"});
group2.orientation = "column";
group2.alignChildren = ["center","center"];
group2.spacing = 2;
group2.margins = 0;

var statictext5 = group2.add("statictext", undefined, undefined, {name: "statictext5"});
statictext5.enabled = false;
statictext5.text = "Dest";

var edittext1 = group2.add('edittext {justify: "center", properties: {name: "edittext1"}}');
edittext1.text = "99";
edittext1.preferredSize.width = 30;
edittext1.preferredSize.height = 28;

var edittext2 = group2.add('edittext {justify: "center", properties: {name: "edittext2"}}');
edittext2.text = "99";
edittext2.preferredSize.width = 30;
edittext2.preferredSize.height = 28;

var edittext3 = group2.add('edittext {justify: "center", properties: {name: "edittext3"}}');
edittext3.text = "99";
edittext3.preferredSize.width = 30;
edittext3.preferredSize.height = 28;

// GROUP5
// ======
var group5 = palette.add("group", undefined, {name: "group5"});
group5.orientation = "column";
group5.alignChildren = ["center","center"];
group5.spacing = 10;
group5.margins = 0;

var button1 = group5.add("button", undefined, undefined, {name: "button1"});
button1.helpTip = "Update data from files";
button1.text = "Update";
button1.preferredSize.width = 100;
button1.preferredSize.height = 28;

var button2 = group5.add("button", undefined, undefined, {name: "button2"});
button2.helpTip = "Send data to Illustrator";
button2.text = "Send";
button2.preferredSize.width = 100;
button2.preferredSize.height = 28;

// ITEM REFERENCE LIST ( Info: http://jongware.mit.edu/Sui/index_1.html )
palette.items = {
L_name: palette.panel1.group1.L_name // group
};
palette.itemsArray = [L_name];

palette.show();

------------------------------------------------------------------------------------------------
I`m using Adobe Photoshop Version: 22.5.5 x64

 

2. I noticed that the display of the user interface elements of the script is different and depends on the applications
How to make the display in Photoshop and Illustrator look the same?

TOPICS
Scripting

Views

175

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
Engaged ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

Photoshop scripting does not have Palette windows support.

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 ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

LATEST

Hi @AnyON, you are right about the answer to question 1.

Unfortunately the answer to question 2 is: you can't. I don't understand why, but ScriptUI elements look different in different apps. In fact it was only in the last year or so that ScriptUI Buttons suddenly became square-cornered in Illustrator.

- Mark

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