I am trying to "upgrade" an old script from DocsList to DriveApp and have a problem calling getFolderById . The script worked using DocsList.getFolder . I have a (previously created) folder called "Email Archive" that I am trying to access in a script. Through the use of logs and a execution script, I verified that I am correctly passing the string "Email Archive" in the baseFolder parameter to the following statement:
var baseFolderObject = DriveApp.getFolderById (baseFolder);
When this statement is executed, I get the following error:
The execution failed: no elements with the specified identifier can be found, or you do not have access to it.
The Email Archive folder was created earlier by the same script with the script call docsList.CreateFolder , and there were no permissions.
Do I need to do something to change the permissions of the folder to allow my script to access it now when I use DriveApp instead of DocsList ? Do I need to create a new folder using DriveApp and specify permissions, and if so, what permissions did I set to allow my script to access the folder and create subfolders and files, not allowing it to be visible to the entire Internet?
Thanks in advance for your help,
~ Jim Fennell
source share