将不同的文件共享到不同的电子邮件

Sharing different files to different emails

我想将 A 列中的每个文件(按文件 ID)与 B 列中的电子邮件共享为(编辑)。示例:我想将A2中的文件与B2中的电子邮件共享,并将A3中的共享文件与B3中的电子邮件共享...

根据您的问题陈述,尝试以下示例脚本:-

function addEditor() {     
  const ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(your sheet Name); // replace sheet name
  const rows = ss.getRange('A2:B').getValues().filter(r=> r[1])
  rows.map(row => DriveApp.getFileById(row[0]).addEditor(row[1]))   
}