侧边栏中的Google Apps脚本授权

master_chef

嗨,我有一个脚本正在为Google Docs模板编写,其中包括一个教程和一些单击按钮以运行脚本(其中一些涉及移动文档或文件夹,因此需要授权)。

问题是,当我尝试通过侧边栏运行脚本时,如果我通过自定义菜单发出请求,则授权窗口将不会弹出。我真的很想使用侧边栏而不是菜单,因为它看起来更好,并允许我包含本教程的图片。我在侧边栏中有一个带有以下代码的按钮:

<button class="create" onclick="google.script.run.addToDrive()">Add to Drive</button><br> 

但是要进行这项工作,我必须有一个冗余菜单,该菜单首先运行相同的功能,以便可以对其进行授权。有没有更好的办法?

谢谢!

摩尔人

您是否正在使用新的文档和新的电子表格?您可以粘贴一些代码吗?

当我想强制显示授权窗口时,有时我将“ foo函数为空”为:

function foo(){
  return 1;
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Google Apps脚本的授权错误

来自分类Dev

如何从Google Apps脚本授权Google语音转文本?

来自分类Dev

弹出授权码DocumentApp-Google Apps脚本

来自分类Dev

弹出授权码DocumentApp-Google Apps脚本

来自分类Dev

google apps脚本日历授权必填循环

来自分类Dev

如何修复Google Apps脚本上的授权错误?

来自分类Dev

带有iFrame的Google Forms Apps脚本侧边栏缺少16像素

来自分类Dev

从Google Apps的侧边栏获取表单数据?

来自分类Dev

Google Apps脚本执行API服务授权每小时失败一次

来自分类Dev

将Google Apps脚本移至v8文件上传已从侧边栏停止工作

来自分类Dev

两栏中的Google Apps脚本日期

来自分类Dev

更新Google Apps脚本侧栏中的内容,而无需重新加载侧栏

来自分类Dev

将按钮单击时的值从Google脚本文件传递到侧边栏

来自分类Dev

在Google表格侧边栏中创建搜索

来自分类Dev

我们可以使用Google Apps脚本在Google Spreasheet中创建数据栏吗?

来自分类Dev

调用Google Apps脚本

来自分类Dev

Google Apps脚本要求

来自分类Dev

Google Apps脚本makeCopy

来自分类Dev

Google Apps脚本:onEdit

来自分类Dev

调用Google Apps脚本

来自分类Dev

执行Google Apps网域授权

来自分类Dev

Google Apps 脚本中的 Google Drive 通知

来自分类Dev

如何使用Google脚本从侧边栏(也是HTML)调用模式对话框(带有HTML文件)

来自分类Dev

Google App Engine与 Google Apps脚本(在Business Apps中)

来自分类Dev

遍历Google Apps脚本中的对象

来自分类Dev

在Google Apps脚本中设置超时

来自分类Dev

在Google Apps脚本中循环数组

来自分类Dev

在Google Apps脚本中创建枚举ButtonSet

来自分类Dev

容器绑定Google Apps脚本中的jQuery?

Related 相关文章

热门标签

归档