这是Google Apps脚本中的一个片段,用于在Google文档/表单/表格中添加菜单.如Menu#addItem方法中所述,它调用了menuItem2函数,但是片段中没有包含关于如何addItem在函数调用中添加参数时调用的示例,或者这是不可能的?
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Custom Menu')
.addItem('First item', 'menuItem1')
.addSeparator()
.addSubMenu(ui.createMenu('Sub-menu')
.addItem('Second item', 'menuItem2'))
.addToUi();
}
function menuItem2() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.alert('You clicked the second menu item!');
}
function menuItem2(PARAMETER_HERE) {
// codes
}
Run Code Online (Sandbox Code Playgroud) 我在MAC OSX 10.8上,我知道这个任务应该用Google搜索,但我仍然有点困惑.
我正在进行一个应该使用厨师独奏的流浪汉部署,但当我去opscode网站时,厨师安装人员被分成厨师 - 客户和厨师 - 服务器,如果我安装厨师客户端会安装厨师独奏?我在网上找不到任何关于厨师独奏的安装程序.安装厨师时还会安装刀吗?
提前致谢.