...
for (j=0;j<it.length;j++ ) {
var ProgressBar = function(title)
{
var d5 = new Window('palette', ' '+title, {x:0, y:0, width:340, height:60}),
pb = d5.add('progressbar', {x:20, y:12, width:300, height:12}, 0, 100),
st5 = d5.add('statictext', {x:10, y:36, width:320, height:20}, '');
st5.justify = 'center';
d5.center();
this.text = function(msg)
{
st5.text = msg;
d5.show();
};
this.hide = function() {d5.hide();};
this.close = function() {d5.close();};
this.reset = function(curValue,maxValue)
{
pb.minValue = 0;
pb.value = curValue;
pb.maxvalue = maxValue;
};
};
var tBar = new ProgressBar("Export...");
var t = j+1;
tBar.hide();
tBar.reset(j, it.length);
tBar.text("Processing: "+t+"/"+it.length);
...