我正在尝试使用脚本返回GSuite日历上所有事件参与者的特定电子邮件地址的列表,我只能返回ID号或仅显示为“ EventGuest,EventGuest,EventGuest的列表... 。“
是否可以返回电子邮件地址本身?在此先感谢您的任何指导!
这是我正在使用的基本脚本:
function listCalendarAttendees(){
var calendar = CalendarApp.getCalendarById('[email protected]');
var sheet = SpreadsheetApp.openById('TEST ID').getSheetByName('Bobs Calendar');
var startTime = new Date();
var endTime = new Date(startTime.getTime()+(1000*60*60*24*7));
var events = calendar.getEvents(startTime, endTime);
Logger.log('Number '+events.length);
for(var x=0;x<events.length;x++){
var event = events[x];
var messages = event.getTitle();
var eventStart = event.getStartTime();
var emails = event.getCreators().toString();
var descriptions = event.getDescription();
var guestListLength = event.getGuestList().length;
var guestListNames =event.getGuestList().toString();
sheet.appendRow([messages,eventStart,emails,descriptions,guestListLength,guestListNames]);
}
}