在 Google 云端硬盘根目录中创建一个新文件夹

function createNewFolderInGoogleDrive(folderName) {
  return DriveApp.createFolder(folderName);
}

使用函数 createNewFolderInGoogleDrive 在 Google 云端硬盘根目录中创建名为 Test folder 的文件夹:

 var newFolder = createNewFolderInGoogleDrive('Test folder');

newFolder类文件夹类型:

// output id of new folder to log
Logger.log(newFolder.getId());