首页 > 解决方案 > 是否可以在 Google Apps 脚本中获取其他人的 UI?

问题描述

在 Google Apps 脚本中,当您使用属性:DocumentApp.getUi()时,它会获取正在使用它的人的 UI。如果您使用DocumentApp.getUi().alert(),那么它会向正在使用该脚本的人发送警报。我想知道是否有办法在 Google Apps 脚本中提醒其他人的 UI,而不是提醒正在使用该脚本的人。这是我的代码示例:

DocumentApp.getActiveDocument()
          .removeViewer(userName.getResponseText())
          .removeEditor(userName.getResponseText());

DocumentApp.getUi()
          .alert("Your access is being removed.")

现在,如果可能的话,那就太好了,想象一下所有的可能性!有人请帮忙!

标签: user-interfacegoogle-apps-script

解决方案


除了调用该函数的浏览器之外,无法访问任何浏览器的 UI。这也是时间驱动触发器无法显示 UI 模式的原因(它们在非本地执行)。


推荐阅读