I'm trying to "upgrade" an old script from DocsList to DriveApp and having a problem with a getFolderById call. The script had worked previously using DocsList.getFolder. I have a (previously-created) folder named "Email Archive" that I'm trying to access in script. Through using Logs and Execution Transcript, I've verified that I'm correctly passing the string "Email Archive" in the baseFolder parameter to the following statement:
var baseFolderObject = DriveApp.getFolderById(baseFolder);
When that statement is executed, I get the following error:
Execution failed: No item with the given ID could be found, or you do not have permission to access it.
The "Email Archive" folder was created previously by the same script with a script call to docsList.CreateFolder, and no permissions were specified.
Do I need to do something to change the folder permissions to allow my script to access it now that I'm using DriveApp instead of DocsList? Do I need to create a new folder using DriveApp and specify permissions, and if so what permissions do I set to allow my script to access the folder and create subfolders and files without allowing it to be visible to the entire Internet?
Thanks in advance for any help,
~ Jim Fennell
DriveApp.createFolder("EmailArchive");
var baseFolderObject=DriveApp.getFolderById("EmailArchive");
Not much there and I still get: Execution failed: No item with the given ID could be found, or you do not have permission to access it. – Jim Fennell