我有一个弹出框,显示方向,但它只在我打开工作表时显示。我希望它在任何有权访问它的用户打开它时运行。只是为了澄清一下,其他用户都是编辑。
我的吐司框确实会显示给其他用户,但html应用程序不会
下面是我的脚本:
function onOpen() {
var message = "Let's have a productive day!";
var title = 'Welcome Back Greeter';+
SpreadsheetApp.getActiveSpreadsheet().toast(message, title, 10);
var htmlApp = HtmlService
.createHtmlOutput('<p>Make sure you mark the following each time a plate is taken or returned: </p>----Salesperson Name </p>----Time Out </p>----Time In </p>----and if it is Pupped! </p>Do not let Salespeople take plates themselves! </p>As Greeters we are responsible for tracking these plates. This sheet is going to be reviewed with Bob each night with a list of which plates are out for the night as well as a list of the plates that are currently in their folders for the next day. </p> Sincerely, The Plate Fairy</p>')
.setTitle('!!!!! ATTENTION GREETER !!!!!')
.setWidth(350)
.setHeight(400);
SpreadsheetApp.getActiveSpreadsheet().show(htmlApp);
}
发布于 2018-06-15 15:54:09
用户必须授予您的脚本权限才能打开对话框。因此,您需要让他们创建一个他们将授权的installable onOpen trigger,并在随后打开时显示您的对话框。
你不能强迫他们这样做,你只能给他们提供类似自定义菜单选项的选项。
发布于 2018-06-15 08:13:59
只有当所有者或编辑打开文档时,才会触发简单触发器。另一方面,简单的触发器有几个限制,比如他们不能打开对话框,侧边栏等等。
有关详细信息,请参阅Simple Triggers
值得注意的是,目前有一些与此主题相关的开放问题。我已经在我对"You do not have permission to call showModalDialog"的回复中提到过
https://stackoverflow.com/questions/50867457
复制相似问题