Copy link to clipboard
Copied
Can some of Macintosh users tell me if it works for you in one of these (or all) Photoshop releases: 2017, 2018 and 2019?
(win = new Window('palette')).show(), $.sleep(5000)
On Windows it shows little palette for 5 seconds, but on Macintosh with CC 2018 either nothing is displayed or white screen.
Please tell me how it's for you, as I don't know this is problem with computer (system), or certain Photoshop, thank you!
I tried the script on Macintosh with photoshop cc14 cc18 cc19
unfortunately it does not work.
Copy link to clipboard
Copied
I tried the script on Macintosh with photoshop cc14 cc18 cc19
unfortunately it does not work.
Copy link to clipboard
Copied
Okey, thank you. But how then you use 'palette' instead of 'dialog' for new Window in your scripts, if you does?
Copy link to clipboard
Copied
in order not to close window in mac try using this method
the window opens after 5 seconds
to exit the window click esc on the keyboard
(win = new Window('palette',"TEST"))
close = false;
win.onClose = function () {
close = true;
};
win.show(), $.sleep(5000)
while (close === false) {
app.refresh();
}
Copy link to clipboard
Copied
Actually I found myself earlier the trick with refresh(), but I wanted to do that without it, as refresh() adds additional second. But now I found something else. refresh() can be used only once, so right after win.show(), not like I was doing that before, so each time when the change to the palette was made:
v = (win = new Window('palette'))
.add('statictext', undefined, 0)
win.show(), refresh(); while(true) {
if (++v.text > 4) break; $.sleep(1000)
}
Copy link to clipboard
Copied
Have you had a look at this thread?
Copy link to clipboard
Copied
Thank you for example with bridgetalk(), however I tried it too earlier and the result was same like without it.
Anyway now there's another problem with progressbar behaviour on Macintosh I have no clue how to solve.
Do you see any solution to recreate following example it worked on Macintosh without second refresh()?
On Windows it works without refresh() after win.update(), but on Macintosh it needs additional seconds:
pb = (win = new Window
('palette')).add('progressbar')
win.show(), refresh(), i = 0
while(true) {
pb.value = ++i / 5 * 100
win.update(), refresh()
if (i > 4) break
}
Copy link to clipboard
Copied
On Windows, it does not always work either. At least on CS6 for sure.
I use this option.
refresh_interface(true);
function refresh_interface(force, cnt)
{
if (!cnt) cnt = 1;
for (var i = 0; i < cnt; i++) _refresh_interface(force);
function _refresh_interface(force)
{
var x = -120;
var tmp = new Window("palette", "", [x,x,x+120,x+120], {borderless:true} );
tmp.opacity = 0;
if (force) tmp.show();
tmp.close();
tmp = null;
}
}
Copy link to clipboard
Copied
borderless:true failed (at least in CS 6) as with some new Window options the right upper part of palette is disappearing. I found the workaround for it: win.show(), win.close(), win.show()
If you know other let me know, and remember this code I used for visible palette so with undefined instead of [x,x,x+120,x+120]
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Kukurykus
I tried on mac with photoshop cc18 cc19 and the progressbar works well.
Copy link to clipboard
Copied
I hope you understand me. Does this code with replacement of second refresh() to $.sleep(1000) works correctly as well?
pb = (win = new Window
('palette')).add('progressbar')
win.show(), refresh(), i = 0
while(true) {
pb.value = ++i / 5 * 100
win.update(), $.sleep(1000)
if (i > 4) break
}
Copy link to clipboard
Copied
For Photoshop, if you want to make a 'palette' (we call them panels now) you will need to use CEP and that SDK/API.
GitHub - Adobe-CEP/Getting-Started-guides: Getting Started guides and samples for CEP extensions
If you first pop a ScriptUI 'dialog' and keep that dialog visible you should be able to create a 'palette' then. Make sure you dismiss the 'palette' before you dismiss the 'dialog'.
Copy link to clipboard
Copied
Yes new palettes are now CEP panels, but to use fully native ones we need Windows or do a trick on Mac.
To do what you suggested is possible on Mac but with palette showed before dialog. Anyway dialog together with palette is confusing, so like in some earlier example I did that with one refresh.
The problem is ProgressBar that doesn't work on Macintosh without refreshing it every iteration in contrary to Windows.
And still when someone doesn't use ZXP installer for extensions but .jsx then there can't be panel yet displayed, so native palette must be used. This way with longer installtion ProgressBar has sense only on Windows, on Mac that's better to use singly refreshed palette (with growing time).