如何避免对复制的Google Spreadsheet +脚本的重新授权请求 [英] How to avoid re-authorization request for a copied Google Spreadsheet + script

查看:47
本文介绍了如何避免对复制的Google Spreadsheet +脚本的重新授权请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个电子表格,可以用作每周报告的模板.此时,我使用DriveApp将未注明日期的模板工作表复制到名称中带有日期的文件中.将为用户显示特定于日期的电子表格,并且可以与其进行交互.完成后,用户将启动一个功能,该功能可将电子表格数据的一部分复制到第三个文件中.

I have a spreadsheet that functions as a template for weekly reports. At this point I copy the undated template sheet using DriveApp to a file that has a date in its name. The user is shown the date-specific spreadsheet and can interact with it. When done the user instigates a function that copies of portion of the spreadsheet data to a third file.

每次用户调用该功能时,都会显示一个授权请求.我试图避免该授权请求.这可能吗?

Every time the user calls the function an authorization request is shown. I am trying to avoid that authorization request. Is this possible?

我正在使用独立的Google Apps脚本将原始模板复制到特定于日期的文件.我考虑过尝试在那里执行所有UI.但是,有太多的意外情况无法实现.复制模板后,按现在的样子,独立脚本将返回特定日期文件的URL并结束.

I am using a stand-alone Google Apps Script to copy the original template to the date-specific file. I have considered trying to perform all of the UI there. However there are too many contingencies to make that practical. As it stands now once the template is copied then the stand-alone script returns the URL of the date-specific file and ends.

推荐答案

每次用户调用该功能时,都会显示一个授权请求.我试图避免该授权请求.这可能吗?

Every time the user calls the function an authorization request is shown. I am trying to avoid that authorization request. Is this possible?

将您的脚本作为附件发布将有助于实现这一点;每个用户都需要对附件进行一次授权,并且该授权将在使用该附件的任何工作表中保持有效.

Publishing your script as an add-on would facilitate this; each user would need to authorize the add-on once, and that authorization would remain in effect in any sheet the add-on was used in.

这篇关于如何避免对复制的Google Spreadsheet +脚本的重新授权请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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