Google Calendar Workspace Add-on函数未触发,Gmail功能正常求助
问题:Calendar插件的
onCalendarEventOpen等函数未触发,Gmail相关功能正常 我按照官方指南搭建了Calendar插件,Gmail相关函数(如onGmailCompose)可正常调用,在Apps Script编辑器的执行记录中能看到,但Calendar的onCalendarEventOpen等函数完全没触发,日志资源管理器里也找不到相关记录。
清单文件(appsscript.json)
{"timeZone": "Europe/Berlin","dependencies": {"enabledAdvancedServices": []},"exceptionLogging": "STACKDRIVER","oauthScopes": ["https://www.googleapis.com/auth/calendar.addons.execute","https://www.googleapis.com/auth/calendar.readonly","https://www.googleapis.com/auth/drive.addons.metadata.readonly","https://www.googleapis.com/auth/gmail.addons.current.action.compose","https://www.googleapis.com/auth/gmail.addons.current.message.readonly","https://www.googleapis.com/auth/gmail.addons.execute","https://www.googleapis.com/auth/script.locale"],"runtimeVersion": "V8","addOns": {"common": {"name": "Cats","logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/pets_black_48dp.png","useLocaleFromApp": true,"homepageTrigger": {"runFunction": "onHomepage","enabled": true},"universalActions": [{"label": "Learn more about Cataas","openLink": "https://cataas.com"}]},"gmail": {"contextualTriggers": [{"unconditional": {},"onTriggerFunction": "onGmailMessage"}],"composeTrigger": {"selectActions": [{"text": "Insert cat","runFunction": "onGmailCompose"}],"draftAccess": "NONE"}},"drive": {"onItemsSelectedTrigger": {"runFunction": "onDriveItemsSelected"}},"calendar": {"eventOpenTrigger": {"runFunction": "onCalendarEventOpen"},"eventUpdateTrigger": {"runFunction": "onCalendarEventUpdate"},"currentEventAccess": "READ"}}}
相关函数代码
function onCalendarEventOpen(e) { console.log(e); console.log("CALENDAR-EVENT-OPEN!!!") } function onCalendarEventUpdate(e) { console.log("CALENDAR-EVENT-UPDATE!!!") }
执行记录截图
仅显示Gmail相关记录,无Calendar记录:
日志资源管理器截图
仅显示Gmail日志,无Calendar相关日志:
内容的提问来源于stack exchange,提问作者kenny_k
相关产品推荐
相关产品推荐

