I want to show a progress bar for one of my Photoshop scripts. If I do work inside a button click event then I'm able to update the progress bar without any problems.
For this script, no user interaction is required. I want to: - Show the Window - Update the progress bar as work is done - Close the Window
var win = new Window("dialog{text:'Progress',bounds:[100,100,400,150],\ bar:Progressbar{bounds:[20,20,280,31] , value:0,maxvalue:100}};");
win.show();
for(...){
//do work here
//update progress
win.bar.value = ...;
}
win.close();
The problem is, win.show();
blocks until the user closes the window. I've also tried to add an onClose
handler then close the window immediately, but the window does not ever show.
Any ideas on how I could get a progress bar to work?
win.update()
each time you increment the bar to force a UI update. – Megalocardia