Skip to content

Instantly share code, notes, and snippets.

@kuyseng
Created May 26, 2012 03:53
Show Gist options
  • Save kuyseng/2792080 to your computer and use it in GitHub Desktop.
Save kuyseng/2792080 to your computer and use it in GitHub Desktop.
javascript: indesign progress bar
function index_progress_bar(title) {
var w = new Window("palette", title, undefined);
w.orientation = "column";
var text_group = w.add("group");
text_group.orientation = "column";
var file_name = text_group.add("statictext", [0,0,350,20], "calculating..");
var remain = text_group.add("statictext", [0,0,350,20], "Remain: ..");
text_group.alignChildren = "left";
var progressbar = w.add("progressbar", undefined, 0, 100);
progressbar.preferredSize = [350,20];
this.reset = function(maxValue) {
progressbar.value = 0;
progressbar.maxvalue = maxValue||0;
progressbar.visible = !!maxValue;
w.show();
};
this.show = function(name, remain_string, value) {
file_name.text = name;
remain.text = remain_string;
progressbar.value = value;
};
this.hide = function() {w.hide();};
this.close = function() {w.close();};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment