Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google脚本:为什么在使用getEventSeriesById()时总是返回空值?_Events_Google Apps Script_Calendar_Google Calendar Api - Fatal编程技术网

Google脚本:为什么在使用getEventSeriesById()时总是返回空值?

Google脚本:为什么在使用getEventSeriesById()时总是返回空值?,events,google-apps-script,calendar,google-calendar-api,Events,Google Apps Script,Calendar,Google Calendar Api,我正在尝试浏览一个ical文件,并查找日历中与ical文件中的事件相匹配的事件的位置。(我知道我的ical文件中的所有事件都存在于我的日历中),但当我运行搜索时,它找不到任何事件,返回的结果是所有事件都不存在 我甚至试着为今天找到一个事件getEventForDay(),并直接将它返回的其中一个事件的ID返回到getEventSeriesById()/getEventById(),但它似乎仍然找不到它 这是一只已知的虫子还是我在做什么蠢事? (对不起,我只是想了解一下谷歌脚本的内容一两天了!)

我正在尝试浏览一个ical文件,并查找日历中与ical文件中的事件相匹配的事件的位置。(我知道我的ical文件中的所有事件都存在于我的日历中),但当我运行搜索时,它找不到任何事件,返回的结果是所有事件都不存在

我甚至试着为今天找到一个事件
getEventForDay()
,并直接将它返回的其中一个事件的ID返回到
getEventSeriesById()
/
getEventById()
,但它似乎仍然找不到它

这是一只已知的虫子还是我在做什么蠢事? (对不起,我只是想了解一下谷歌脚本的内容一两天了!)

下面是我的quick dirty函数,它只是强制一个已知ID直接返回:

function quickCheck(){
  var myCal = CalendarApp.getCalendarById("xxxxxxx");
  var eventsToday = myCal.getEventsForDay(new Date());

  var evById = myCal.getEventSeriesById(eventsToday[0].getId())
  Logger.log("Desc test: " + evById.getTitle());
}
这只是抛出了一个错误:

TypeError:无法调用null的方法“getTitle”

如有任何建议/见解,将不胜感激


编辑:需要注意的是:这些事件都是facebook事件;如果我创建一个标准的google事件,它就可以工作

这对我有用。您的id可能不正确。请在分配
myCal
时再次检查您的日历id是否正确。它应该包括
@group.calendar.google.com
@group.v.calendar.google.com
,根据