I wrote a very bad script to automate the creation of a project folder structure in Google appscript. I understand that I have to have the Advanced Drive Service enabled. (Which I do) and I that I need to include the query parameter {supportsAllDrives=true} in my script but I just do not know how to incorporate it.
My script is essentially creating folders and it's sub folders and nesting those folders and making copies of files and placing them in those folders. The code I put is only for one of the many folders that need to be created. If I can understand how to use the supportsAlldrives=true argument I can go an apply to the rest of the script.
I'm just not sure on where to insert the query parameter of "supports all drives". I have the Api enabled.
Where and how do I insert the support all drives argument?
function siteBuild() {
var fldrname= SpreadsheetApp.getActiveSpreadsheet().getRange("D2").getValue();
var mainFolder = DriveApp.createFolder(fldrname).getId();
var finaldestination = DriveApp.getFolderById(mainFolder);
//Creates First Layer of Folders
var allFolders =["0.FDOB Newsletter + UX Survey","1.Cost Control","2.Network + Low Voltage","3.Audio Visual","4.Construction Docs","5.Schedules","1.Circuit Information","2.Design","3.Installation & Commissioning","4.Photos","5.As Builts","1. Communications Sent (Email,Template)","2. UX Survey and Results","Heatmaps","Final","Installation","Site Survey","1.Design","2.Installation & Commissioning","3.Photos","4.As Builts","Architecturals + Schematics","Programming Files"]
var dest = DriveApp.createFolder(allFolders[0]).getId();
var fdob1 = DriveApp.createFolder(allFolders[11]).getId();
var fdob2 = DriveApp.createFolder(allFolders[12]).getId();
//Creates & Moves "0.FDOB Newsletter + UX Survey"
var fdobfldrs1 = DriveApp.getFolderById(fdob1);
var fdobfldrs2 = DriveApp.getFolderById(fdob2);
var destination = DriveApp.getFolderById(dest);
fdobfldrs1.moveTo(destination);
fdobfldrs2.moveTo(destination);
Thank you!