Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

How to bring palette (progress bar) to the front?

$
0
0

Hi all,

 

I am having a problem where my progress bar for my script will not display correctly, i believe this is because it is not the focused window.

I was wondering if there is anything in illustrator scripting similar to the window.focus method in javerscript? Or any other way of achieving this.

 

The progress bar will work fine in CS6 even though it is not the focus, but i need the script to be able to run on both 5 and 6.

 

The progress bar code is as follows:

 

    var win = new Window("palette", "Progress bar", [150, 150, 600, 260]);  

    win.pnl = win.add("panel", [10, 10, 440, 100], "Script Progress"); 

    win.pnl.progBar = win.pnl.add("progressbar", [20, 35, 410, 60], 0, 100); 

    win.pnl.progBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], "Collecting images... 0%"); 

    var task = "collecting images..."

    win.show(); 

    win.pnl.progBar.show();

 

                    while(win.pnl.progBar.value < win.pnl.progBar.maxvalue) 

                    {  win.update();

                              win.pnl.progBar.show();

                              if (win.pnl.progBar.value == 0){

                                  imageCollection();

                                  task =  "Saving AI file...";}

                              if (win.pnl.progBar.value == 20){

                                  SaveAI();

                                  task = "Outlining text...";}

                              if (win.pnl.progBar.value == 40){

                                  OutlineText (app.activeDocument.layers);

                                  task = "Saving Outlined File...";}

                              if (win.pnl.progBar.value == 60){

                                  SaveAIOutlined();

                                  task = "Saving PDF...";}

                              if (win.pnl.progBar.value == 80){

                                  SavePDF();}

                             

                             

                              win.pnl.progBar.value = win.pnl.progBar.value + 20;  

          win.pnl.progBarLabel.text = task + win.pnl.progBar.value+"%"; 

                    } 

                task = "Script Complete. "

    win.pnl.progBarLabel.text = task + win.pnl.progBar.value+"%"

  win.update();

  app.activeDocument.close();

    alert("Script Complete");  

 

win.close();


Im using Mac OS 10.6.8, any help at all would be appreciated.

 

Regards,

Tom


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>