首次授予打开权限以使用Google表格中的绑定脚本 [英] Grant permissions on open for first time for a bound script in Google Sheets

查看:55
本文介绍了首次授予打开权限以使用Google表格中的绑定脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有绑定脚本的Google Spreadsheet模板,例如,运行时创建文本中带有各种标签的Google Docs文件的副本,并将其替换为电子表格中的数据,或者打开一个提示表单,其中我可以介绍一些数据,并用它填充单元格.当脚本第一次运行时,它要求用户授权,用户必须给出授权,然后脚本停止运行,他必须再次运行代码.

I created a Google Spreadsheet template with a script bounded to it that, for example, when runs creates a copy of a Google Docs file with various tags in the text and replaces them with data from the spreadsheet or opens a prompt form where I can introduce some data and it fills cells with that. When the script runs for first time it request for user's authoritzation, the user has to give authoritzation, then the script stops running and him has to run the code again.

我想授予所有模板副本的许可,或者,如果不可能的话,我希望在首次打开电子表格时请求所有授权(所有可以创建模板副本并可以访问模板的用户始终是一样).

I would like to grant permits for all template copies or, if it's not possible, request for all authoritzations when de spreadsheet is opened for first time (all users that can create a copy of the template and access to it are always the same).

谢谢.

推荐答案

据我了解,这是不可能的,因为您的脚本是容器绑定到工作表的(

From what I understand that is not possible as your script is container-bound to the sheet (https://developers.google.com/apps-script/guides/bound) so each time you copy the container you have to renew the permission.

另请参阅什么是最好的创建可以克隆的容器绑定脚本的方法?

唯一的解决方法是创建一个独立的加载项( https://developers.google.com/apps-script/guides/standalone ).

The only way around it is to create a stand alone add-on (https://developers.google.com/apps-script/guides/standalone).

这篇关于首次授予打开权限以使用Google表格中的绑定脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆