【发布时间】:2015-05-22 03:55:48
【问题描述】:
我的应用已获得批准,我正处于需要插件安装测试的最终批准阶段。
这是 Google Docs UX 团队所说的
“authMode 设置似乎有问题 - 可能在 onOpen 函数。这会导致菜单项仅出现在 安装插件的第一个文档。在所有其他文档上显示为空 (附截图)。欲了解更多信息: https://developers.google.com/apps-script/add-ons/lifecycle#opening"
这是一个未解决的类似问题Google Add-on adding menu items in limited mode app scripts 现在,我在 onOpen 和 onInstall 上没有做任何特别的事情,只是教科书上的东西。有小费吗? (编辑了菜单标题...)
function onOpen(e) {
DocumentApp.getUi().createAddonMenu()
.addItem('menu1...', 'showSidebar')
.addItem('Buyxxxxx', 'showSales')
.addItem('Getting Started', 'showIntro')
.addToUi();
}
/**
* Runs when the add-on is installed.
*
* @param {object} e The event parameter for a simple onInstall trigger. To
* determine which authorization mode (ScriptApp.AuthMode) the trigger is
* running in, inspect e.authMode. (In practice, onInstall triggers always
* run in AuthMode.FULL, but onOpen triggers may be AuthMode.LIMITED or
* AuthMode.NONE.)
*/
function onInstall(e) {
onOpen(e);
}
【问题讨论】:
标签: google-apps-script google-docs