[英]Google apps script permission to access a folder
This simple code works in a standalone script and also in a script bound to a google sheet if i run directly the function, but get a permission error when i run it opening the sheet. 如果我直接运行该函数,则此简单代码可在独立脚本中运行,也可在绑定到Google工作表的脚本中工作,但是在我打开工作表运行它时会出现权限错误。 Where is the problem?
问题出在哪儿?
function onOpen() {
jsondir = DriveApp.getFolderById("XXXXXXXXXXXXXXXXXXXXXXXXXXXX")
Logger.log(jsondir)
}
In the case of use of method (DriveApp) which is required the authorization, the function has to be installed as a trigger. 在使用需要授权的方法(DriveApp)的情况下,该功能必须作为触发器安装。 How to install the trigger is as follows.
触发器的安装方法如下。 The detail information is here .
详细信息在这里 。
If I misunderstand your question, I'm sorry. 如果我误解了您的问题,对不起。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.