【发布时间】:2019-12-02 22:53:29
【问题描述】:
如何在运行 google app 脚本时显示负载指示器
【问题讨论】:
标签: google-apps-script google-sheets-macros
如何在运行 google app 脚本时显示负载指示器
【问题讨论】:
标签: google-apps-script google-sheets-macros
如果您想在图像显示和执行时停止与工作表的交互,您可以尝试使用UI 方法showModalDialog()。
所以这样的事情可以解决你想要实现的目标:
function showDialog() {
var ui = SpreadsheetApp.getUi();
// Display a modal dialog box with custom HtmlService content.
var htmlOutput = HtmlService
.createHtmlOutput('<img src=https://i.stack.imgur.com/AuqJU.gif>')
.setWidth(250)
.setHeight(300);
ui.showModalDialog(htmlOutput, 'Script Running');
}
如果您想更好地控制对话框的关闭,您需要从客户端执行此操作。修改 showModalDialog() 内的 HTML 对象。如果您对此感兴趣,我建议您查看this question。
您还可以查看有关 dialogs and other UI elements 的 Apps 脚本文档。