运行 Google 表单提交上的 Apps 脚本客户端

Run Apps Script Client Side on Google Form Submit

我目前正在尝试使用 google 表单和应用程序脚本制作文书工作向导。在表单的末尾,一旦表单提交并显示 HTML window,我将尝试 运行 Apps 脚本。我尝试将 FormApp.getUI() 与应用程序事件触发器一起使用,但我不断收到错误 Exception: Cannot call FormApp.getUi() from this context. 从其他帖子看来,这个错误似乎是因为触发器 运行 是脚本服务器端。有没有办法 运行 这个脚本客户端可以显示 HTML window?

编辑:Conditional Sections Google forms这个问题与我现在问的问题不同。

EDIT2:代码

Code.gs

function myFunction() {
  var lock = LockService.getScriptLock();

  var html = HtmlService.createHtmlOutputFromFile('display');
    FormApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
    .showModalDialog(html, " Let's check if you need to present!");
    SpreadsheetApp.flush();
    lock.releaseLock();
}

display.html

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

来自问题:

At the end of the form, I'm trying to run an Apps Script once the form submits and display a HTML window.

这是不可能的。

如果您收集了受访者的电子邮件地址,您可以向他们发送电子邮件