Skip to content

Instantly share code, notes, and snippets.

@UskeS
Last active August 8, 2018 11:28
Show Gist options
  • Save UskeS/4b09edea21d39e35e7915fe5eeabf9e0 to your computer and use it in GitHub Desktop.
Save UskeS/4b09edea21d39e35e7915fe5eeabf9e0 to your computer and use it in GitHub Desktop.
ExtendScriptのScriptUIを利用したカスタムダイアログ
var multiBtnDlg = function(title, text, list, focus) {
var cDlg = new Window("dialog", title);
cDlg.add("statictext", undefined, text, {multiline: true});
var btnGrp = cDlg.add("group");
var btnList = [];
for (var i=0; i<list.length; i++) {
if (i === focus) {
btnList.push(btnGrp.add("button", undefined, list[i], {name: "ok"}));
} else {
btnList.push(btnGrp.add("button", undefined, list[i]));
}
eval(
"btnList[i].onClick = function() {\n"+
" cDlg.close("+(i+5)+");\n"+
"}");
}
return cDlg.show();
};
//multiBtnDlg ("title", "こんな感じです。", ["はい", "え?", "そやな", "なんでや工藤"], 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment