嗯,我轉移了多個文件的屬性,我想省略通知電子郵件,我在圖書館中發現了一些模型,但是如果有人沒有我的代碼,我就無法做到這一點能幫助我,我會感激更改所有者併發送電子郵件
function folderTransfer()
{
var pas = DriveApp.getFolderById("ID");
var arquivos = pas.getFiles();
var me = 'email'; /* tirar este e-mail e deixar que seja qualquer prop.*/
var novoProp = 'email';
var pastas = pas.getFolders();
while (pastas.hasNext())
{
var pasta = pastas.next();
var pastaID = pasta.getId();
fileTransfer(pastaID, me, novoProp);
pasta.setOwner(novoProp);
pasta.removeEditor(me);
}
//Transferir pasta pai para novoProp
pas.setSharing(DriveApp.Access.PRIVATE, DriveApp.Permission.VIEW);
pas.setOwner('email');
pas.removeEditor('email');
function fileTransfer(pastaID, prop, novoProp)
{
var pasta = DriveApp.getFolderById('id');
var arquivos = pasta.getFiles();
while (arquivos.hasNext())
{
var arquivo = arquivos.next();
arquivo.setSharing(DriveApp.Access.PRIVATE, DriveApp.Permission.VIEW);
arquivo.setOwner('email');
arquivo.removeEditor('email');
}
}
}
重複的https://stackoverflow.com/questions/21189936/share-a-drive-document-without-notifying-user-with-google-apps-script – Brian
不幸的是我不知道我在做什麼錯,但這個例子不起作用 –