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. 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. How to install the trigger is as follows. The detail information is here .
If I misunderstand your question, I'm sorry.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.