【发布时间】:2015-07-08 03:18:10
【问题描述】:
我正在开发一个 Google 表格插件,并试图让脚本既关闭 HTML 侧边栏又打开一个对话框。
下面的代码不起作用,因为对话框是打开然后关闭的。
HTML 文件
google.script.run.gsSheetCreateSuccess();
google.script.host.close();
.gs 文件
function gsSheetCreateSuccess() {
var ui = SpreadsheetApp.getUi()
ui.alert(
'Setup Complete',
"Success! You've Successfully completed setup on this spreadsheet.",
ui.ButtonSet.OK)
}
下面的代码(反面)不起作用,因为 HTML 文件(侧边栏)在执行 google.script.run.gsSheetCreateSuccess(); 并打开对话框之前已关闭。
HTML 文件
google.script.host.close();
google.script.run.gsSheetCreateSuccess();
如何同时关闭侧边栏并打开对话框?
【问题讨论】:
标签: javascript html google-apps-script