Skip to content

Instantly share code, notes, and snippets.

@UskeS
Created September 22, 2018 04:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UskeS/e1caf22b7cccf250002f1ff856f4eff3 to your computer and use it in GitHub Desktop.
Save UskeS/e1caf22b7cccf250002f1ff856f4eff3 to your computer and use it in GitHub Desktop.
[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