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

(win = new Window('palette')).show(), $.sleep(5000)

LEGEND ,
May 04, 2019 May 04, 2019

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!

TOPICS
Actions and scripting

Views

1.8K

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

Advocate , May 05, 2019 May 05, 2019

I tried the script on Macintosh with photoshop cc14 cc18 cc19

unfortunately it does not work.

Votes

Translate

Translate
Adobe
Advocate ,
May 05, 2019 May 05, 2019

Copy link to clipboard

Copied

I tried the script on Macintosh with photoshop cc14 cc18 cc19

unfortunately it does not work.

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
LEGEND ,
May 05, 2019 May 05, 2019

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?

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
Advocate ,
May 05, 2019 May 05, 2019

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

}

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
LEGEND ,
May 07, 2019 May 07, 2019

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)

}

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
Guide ,
May 05, 2019 May 05, 2019

Copy link to clipboard

Copied

Have you had a look at this thread?

Defining the stroke size by slider

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
LEGEND ,
May 07, 2019 May 07, 2019

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

}

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
People's Champ ,
May 07, 2019 May 07, 2019

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;       

        }

    }       

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
LEGEND ,
Jan 30, 2020 Jan 30, 2020

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]

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
People's Champ ,
Jan 31, 2020 Jan 31, 2020

Copy link to clipboard

Copied

LATEST
I don’t know what you are talking about, but "borderless: true" works on CS6.

I have another unresolved issue. I can not do anything since there is no access to the MAC. Maybe you can check and solve the problem.

If you create a modal dialog of a sufficiently large size and make a button in it that will call the function of showing a small palette, then it’s like on the MAC we get that the palette will be under the main dialog (or dialogs) and we simply won’t see it (the palette). If such a problem is really observed on the MAC, then how can it be solved?
 

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
Advocate ,
May 08, 2019 May 08, 2019

Copy link to clipboard

Copied

Kukurykus

I tried on mac with photoshop cc18 cc19 and the progressbar works well.

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
LEGEND ,
May 08, 2019 May 08, 2019

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

}

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
Adobe Employee ,
May 17, 2019 May 17, 2019

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

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
LEGEND ,
May 17, 2019 May 17, 2019

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

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