在appsscript.json 文件中,当eventOpenTrigger 动作触发时,会调用onCalendarEventOpen 函数。
"calendar": {
....
"currentEventAccess": "READ_WRITE",
"eventOpenTrigger": {
"runFunction": "onCalendarEventOpen"
},
"eventUpdateTrigger": {
"runFunction": "onCalendarEventUpdate"
}
}
在 onCalendarEventOpen 中,我完成了控制台日志以获取事件详细信息。
function onCalendarEventOpen(e){
...
console.log(JSON.stringify(e));
...
}
从 console.log 中,我可以得到以下数据,其中包含参考、与会者等详细信息,但不包含事件名称、摘要、时间、位置详细信息。
{"calendar":{"capabilities":{"canSeeConferenceData":true,"canSeeAttendees":true,"canAddAttendees":true,"canSetConferenceData":true},"calendarId":"xyz@gmail.com","organizer":{"email":"xyz@gmail.com"},"id":"2a2gdhrpmcpm8rmav4s2sam8nc"},"userCountry":"","userLocale":"en","hostApp":"calendar","clientPlatform":"web","commonEventObject":{"userLocale":"en","hostApp":"CALENDAR","timeZone":{"offset":19800000,"id":"Asia/Kolkata"},"platform":"WEB"},"userTimezone":{"offSet":"19800000","id":"Asia/Kolkata"}}
如何在 eventOpenTrigger 中获取事件名称、描述和其他与事件相关的详细信息?