标题说明了一切。好吧,至少我希望它确实......提前感谢您的帮助。' 函数 onOpen() { var folder = DocsList.getFolder("我的文件夹"); var 内容 = 文件夹.getFiles(); 变量文件;变量数据;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.clearContents();
sheet.appendRow(["Link", "Name", "Type", "ID"]);
for (var i = 0; i < contents.length; i++) {
file = contents[i];
var value1,value2,value3;
if (file.getFileType()==DocsList.FileType.SPREADSHEET) {
var otherSheet = SpreadsheetApp.open(file).getSheetByName("Sheet1");
value1 = otherSheet.getRange('B2').getValue();
value2 = otherSheet.getRange('B7').getValue();
value3 = otherSheet.getRange('B3').getValue();
} else {
value1 = null; value2 = null; value3 = null; value4 = null;
}
sheet.appendRow([ file.getUrl(),value1,value2,value3,value4]);
}
};'