我正在与Google电子表格结合使用Google脚本。我的想法是制作一个能够读取日历中事件的电子表格。我可以水平阅读纸,但是我想垂直阅读纸。
请参阅下面的脚本。
function caltest1() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 23; // First row of data to process
var numRows = 2; // Number of rows to process
var dataRange = sheet.getRange(startRow, 1, numRows, 10);
var data = dataRange.getValues();
var cal = CalendarApp.getDefaultCalendar();
for (i in data) {
var row = data[i];
var tstart = new Date(row[1]);
var tstop = new Date(row[7]);
var title = row[0]; // First column
var desc = row[2]; // Second column
var guest = row[8];
var loc = row[9];
cal.createEvent(title, tstart, {description: desc, location: loc, sendInvites: true, guests: guest});
}
}