Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[ExtendScript] SUIでプログレスバーを表示するサンプル
#targetengine session
var fonts = app.fonts;
var fontLength = fonts.length;
var fontList = [];
var dlg = new Window("palette");
dlg.add("staticText", undefined, "フォントを読み込んでいます...");
dlg.alignChildren = "fill";
var pb = dlg.add("progressbar", undefined, 0, fontLength);
pb.preferredSize.width = 300;
var vt = dlg.add("staticText", undefined, "0/"+fontLength);
//vt.preferredSize = [100, 20];
dlg.show();
for (var i=0; i<fontLength; i++) {
fontList.push(fonts[i].fontFamily);
pb.value = i+1;
vt.text = pb.value + "/"+fontLength;
dlg.update();
}
dlg.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment