Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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