Skip to main content
Inspiring
September 26, 2013
Question

Any way to force Photoshop to launch and keep visible a window of type "palette"?

  • September 26, 2013
  • 2 replies
  • 1896 views

Hi friends

I have a script that works perfectlly in Adobe Illustrator. Now I want to make a version of this script for Adobe Photoshop. The problem is: the scripts is based on a window of type "palette".

Basically the original script launches a window of type palette with some buttons. It gets visible and allow user to work normally. When user presses a button, the script configures a BridgeTalk object then sends the specific function as a message to Illustrator executes. Works great in Illustrator.

But, AFAIK, window of type palette is not compatible with Photoshop (at least is what manual describes). In my tests, If I try to lauch a dialog of type palette in Photoshop, it shows and instantlly closes automatically (it does not keep opened). I´m not considering the run via the ESToolkit. I´m talking about the direct run in Photoshop.

Perhaphs I´m missing anything, but, Is there any way to launch a palette in Photoshop?

Thank you verry much for the tips.

Best Regards.

This topic has been closed for replies.

2 replies

DBarranca
Legend
September 26, 2013

Hi Gustavo,

see here:

ScriptUI Window in Photoshop – Palette vs. Dialog

and better:

ScriptUI – BridgeTalk persistent Window examples

Basically up to CS6 you could do all the tricks the first article shows, then CC broke that and you have to follow the second article's path.

After all, 'palettes' in Photoshop were never supported (see in the JavaScript Tools Guide CC) so they can't be broken now ;-)

Since BridgeTalk is involved, you might want to check this article too, in order to be able to Export as Binary safely.

Ciao!

Davide Barranca

www.davidebarranca.com

Inspiring
September 27, 2013

Hey Davide

Thank you a lot for the answer.

I´ve just read your first link (the post about palette and dialogs) and I tried your script for PS palette working example (using the app.refresh()). I copied the entire code, saved as JSX and invoked in Photoshop.

In your example, the palette opened normally and was kept visible (this was great, no errors), but I was not able to continue working in Photoshop when the palette is visible :/

Is it supposed to behave this way? Am I missing anything?

Using Photoshop CS6, Windows 7 64 bits.

Thank you very much for the help.

Gustavo.

DBarranca
Legend
September 27, 2013

Hi Gustavo,

the following, which is from "PS Palette working example" in the first link, works to me (for instance I can create a New Document while the palette shows) in Mac: CS4, CS5.x and CS6 - but not CC (as expected):

var isDone, s2t, waitForRedraw, win, windowResource;

// Shortcut function

s2t = function(stringID) {

  return app.stringIDToTypeID(stringID);

};

waitForRedraw = function() {

  var d;

  d = new ActionDescriptor();

  d.putEnumerated(s2t('state'), s2t('state'), s2t('redrawComplete'));

  return executeAction(s2t('wait'), d, DialogModes.NO);

};

//sentinel variable

isDone = false;

windowResource = "palette {  \    orientation: 'column', \    alignChildren: ['fill', 'top'],  \    preferredSize:[300, 130], \    text: 'ScriptUI Window - palette',  \    margins:15, \    \    sliderPanel: Panel { \        orientation: 'row', \        alignChildren: 'right', \        margins:15, \        text: ' PANEL ', \        st: StaticText { text: 'Value:' }, \        sl: Slider { minvalue: 1, maxvalue: 100, value: 30, size:[220,20] }, \        te: EditText { text: '30', characters: 5, justify: 'left'} \        } \    \    bottomGroup: Group{ \        cd: Checkbox { text:'Checkbox value', value: true }, \        cancelButton: Button { text: 'Cancel', properties:{name:'cancel'}, size: [120,24], alignment:['right', 'center'] }, \        applyButton: Button { text: 'Apply', properties:{name:'ok'}, size: [120,24], alignment:['right', 'center'] }, \    }\}";

win = new Window(windowResource);

// Button listeners

win.bottomGroup.cancelButton.onClick = function() {

  return isDone = true;

};

win.bottomGroup.applyButton.onClick = function() {

  return isDone = true;

};

// don't forget this one!

win.onClose = function() {

  return isDone = true;

};

win.show();

while (isDone === false) {

  app.refresh(); // or, alternatively, waitForRedraw();

}

Best,

Davide

www.davidebarranca.com

Tom Ruark
Inspiring
September 26, 2013

Photoshop CS4 and later supports SWF based panels and with Photoshop CC HTML based panels. And here is an update on that front as well: http://forums.adobe.com/message/5692258