예시
스크립트
function onOpen() {
createMenuWithSubMenu();
}
function createMenuWithSubMenu() {
SpreadsheetApp.getUi().createMenu("✨")
.addItem("Refresh IA", "makeSheetThemeIA_3")
.addToUi();
}
function onOpen() {
createMenuWithSubMenu();
}
function createMenuWithSubMenu() {
var subMenu = SpreadsheetApp.getUi().createMenu("Advanced")
.addItem("Setting D", "settingD")
.addItem("Setting E", "settingE");
SpreadsheetApp.getUi().createMenu("⚙️ Admin Settings")
.addItem("Setting A", "settingA")
.addItem("Setting B", "settingB")
.addSeparator()
.addSubMenu(subMenu)
.addToUi();
}
function settingA() {
SpreadsheetApp.getActive().toast("You selected Setting A.");
}
function settingB() {
SpreadsheetApp.getActive().toast("You selected Setting B.");
}
function settingD() {
SpreadsheetApp.getActive().toast("You selected Setting D.");
}
function settingE() {
SpreadsheetApp.getActive().toast("You selected Setting E.");
}