Google apps script Google脚本CardService.newButtonStation()正在变为null
在附加到Google电子表格的脚本中,我有一个用于启动/停止脚本的自定义菜单项。根据存储在别处的实际状态,我希望更改提示窗口。一个问题是,Google apps script Google脚本CardService.newButtonStation()正在变为null,google-apps-script,google-sheets,Google Apps Script,Google Sheets,在附加到Google电子表格的脚本中,我有一个用于启动/停止脚本的自定义菜单项。根据存储在别处的实际状态,我希望更改提示窗口。一个问题是,CardService.newbuttstation()似乎正在变为null,因此添加按钮会导致错误 var state = true //Comes from DocumentProperties var onButton = CardService.newTextButton().setText("Spustit") var offButton
CardService.newbuttstation()
似乎正在变为null,因此添加按钮会导致错误
var state = true //Comes from DocumentProperties
var onButton = CardService.newTextButton().setText("Spustit")
var offButton = CardService.newTextButton().setText("Pozastavit")
var cancelButton = ui.Button.CANCEL
var buttonSet
if (state == "true"){
msg = "Do you want to stop the scripts?"
title = "Automatic update is on"
// Here I get the error: "Cannot find method addButton(Button)"
buttonSet = CardService.newButtonSet().addButton(offButton).addButton(cancelButton)
} else if (state == "false"){
msg = "Do you want allow the scripts"
title = "Automatic update is off"
buttonSet = CardService.newButtonSet().addButton(onButton).addButton(cancelButton)
} else {
msg = "Do you want to switch automation on or off?"
title = "Automation"
buttonSet = CardService.newButtonSet().addButton(onButton).addButton(offButton).addButton(cancelButton)
}
你有提示吗,怎么了?来自
目前,您只能使用此服务构建Gmail附加组件
非常感谢。我没想到原因这么简单。@JTV请结帐