4 Replies Latest reply on Sep 15, 2012 11:06 AM by Muppet Mark

    ScriptUI - bring palette to front on Mac

    Silly-V Adobe Community Professional

      Howdy yall!  Please consider this:  on my Windows 7 home computer I am able to create UI progress bars and popup messages for my UI window and everything works just fine.  Now, I come to work on the Macintosh and they don't work so well.  In this question, I would like to learn if there is a technique to bring a palette to the front when one is created, such as for this progress bar example, on a Mac.  The palette appears deactivated and in back for me.  It is unseen most of the time because it appears in the center of the screen behind the window by default, and when I move my window we can see the palette but there is no progress bar going on.

       

      As you can see in the screenshot, my main window is deactivated because I attempted to get the progress bar active by deactivating the main window, obviously not successful.  I also set the palette to active, which did not work.

       

      And, as I have implied, on my home computer on Windows things appear just as expected with the progress bar working and palettes appearing in front and active.  Does anybody know what could be the issue?

       

      Thank you!

       

      Screen shot 2012-09-15 at 9.36.24 AM.png

        • 1. Re: ScriptUI - bring palette to front on Mac
          Silly-V Adobe Community Professional

          Oh yes, by the way, here is the gist of the code used:

           

          var w = new Window("dialog");

          w.size = [300,200];

           

           

          var btn = w.add("button",undefined,"show a palette, please");

          btn.onClick=function(w){

              var P = new Window("palette");

              P.add("statictext",undefined,"My Palette.");

              P.active = true;

              P.show();

              $.sleep(2000);

              P.close();

          }

           

           

          w.show();

          • 2. Re: ScriptUI - bring palette to front on Mac
            Muppet Mark Level 5

            Try this… The problem is your first UI window is a dialog this holds focus intil dismised… You can either close it when the button is clicked or have palette load palette and change focus…?

             

            #target illustrator
            
            var w = new Window("palette");
            w.size = [300,200];
            w.active = true;
            
            var btn = w.add("button",undefined,"show a palette, please");
            btn.onClick=function(w){
                var P = new Window("palette");
                P.add("statictext",undefined,"My Palette.");
                P.active = true;
                P.show();
                $.sleep(2000);
                P.close();
            }
            
            w.show();
            
            1 person found this helpful
            • 3. Re: ScriptUI - bring palette to front on Mac
              Silly-V Adobe Community Professional

              This helps clarify the problem.  However if I use this, from ETSK Illustrator pops up into focus, shows the palette and disappears- ETSK comes to front.  When I click back to AI, the window is still there and does the job.  But, when ran from  AI itself, the window seems to appear and instantaneously disappear. 

               

              I would like to actually keep the window a dialog if I can, so I may resort to putting a little area on the window to show progress or messages.  Maybe.

              • 4. Re: ScriptUI - bring palette to front on Mac
                Muppet Mark Level 5

                I think it would be better to update the existing window rather than add a new… Try a button in your palette…