我已经编写了一个Google驱动器脚本,该脚本将为我们公司自动创建项目特定的空白文件夹,但是在调试时,我收到错误消息:
不能在Team Drive项目上使用此操作。 (第10行,文件“创建文件夹结构”)
有人知道解决方法吗,还是我应该等到Google在团队合作中添加此功能后,再说?在这里无法选择“我的云端硬盘”并进行共享。
下面是我到目前为止的完整代码。
function createFolderStructure() {
//Create the new folder
var projectFolder = DriveApp.createFolder('18-LOB-XX');//insert project name here inside ' ' VERY IMPORTANT FILL IN
//Get the master folder
var LOBprojectsFolder = DriveApp.getFolderById("1c2VFadI6vFCMAlh45Ni7lbjW8L3oRKOF");//ID for Current Clients folder goes here inside " "
//add new folder to current client folder
LOBprojectsFolder.addFolder(projectFolder);
DriveApp.getRootFolder().removeFolder(projectFolder);
//FIRST TIER//
//Create the new folders
var desktopFolder = DriveApp.createFolder('Desktop Wetlands Evaluation');
var checklistFolder = DriveApp.createFolder('Checklist for Farm Loans');
var rsraFolder = DriveApp.createFolder('RSRA');
var lobFolder = DriveApp.createFolder('LOB');
//add new folders to new folder and remove extra root drive folders
projectFolder.addFolder(desktopFolder);
DriveApp.getRootFolder().removeFolder(desktopFolder);
projectFolder.addFolder(checklistFolder);
DriveApp.getRootFolder().removeFolder(checklistFolder);
projectFolder.addFolder(rsraFolder);
DriveApp.getRootFolder().removeFolder(rsraFolder);
projectFolder.addFolder(lobFolder);
DriveApp.getRootFolder().removeFolder(lobFolder);
//SECOND TIER//
//Desktop Sub Folder//
var soilsFolder = DriveApp.createFolder('Soils');
desktopFolder.addFolder(soilsFolder);
DriveApp.getRootFolder().removeFolder(soilsFolder);
//SECOND TIER//
//Checklist Sub Folders//
var finalReportFolder = DriveApp.createFolder('Final Report');
var flySheetsFolder = DriveApp.createFolder('Fly Sheets');
var appendicesFolder = DriveApp.createFolder('Appendices');
checklistFolder.addFolder(finalReportFolder);
DriveApp.getRootFolder().removeFolder(finalReportFolder);
checklistFolder.addFolder(flySheetsFolder);
DriveApp.getRootFolder().removeFolder(flySheetsFolder);
checklistFolder.addFolder(appendicesFolder);
DriveApp.getRootFolder().removeFolder(appendicesFolder);
//SECOND TIER//
//RSRA Sub Folders//
var edrFolder = DriveApp.createFolder('EDR')
var finalReportFolder = DriveApp.createFolder('Final Report')
var flySheetsFolder = DriveApp.createFolder('Fly Sheets')
var reportFolder = DriveApp.createFolder('Report')
rsraFolder.addFolder(edrFolder);
DriveApp.getRootFolder().removeFolder(edrFolder);
rsraFolder.addFolder(finalReportFolder);
DriveApp.getRootFolder().removeFolder(finalReportFolder);
rsraFolder.addFolder(flySheetsFolder);
DriveApp.getRootFolder().removeFolder(flySheetsFolder);
rsraFolder.addFolder(reportFolder);
DriveApp.getRootFolder().removeFolder(reportFolder);
//END OF SCRIPT//
}
谢谢!