Google apps script 如何让其他所有者共享谷歌日历事件?
我是日历api的新手,有几个基本问题 我想在所有日历上获取其他用户,tonya123456@gmail.com和我一起分享。她是主人,不是我 “此用户拥有或订阅了0.0日历”是我运行此代码时的响应:Google apps script 如何让其他所有者共享谷歌日历事件?,google-apps-script,google-calendar-api,Google Apps Script,Google Calendar Api,我是日历api的新手,有几个基本问题 我想在所有日历上获取其他用户,tonya123456@gmail.com和我一起分享。她是主人,不是我 “此用户拥有或订阅了0.0日历”是我运行此代码时的响应: var calendar = CalendarApp.getCalendarsByName('tonya123456@gmail.com'); if(calendar == null){ //user may not have access, auto-subscribe them. calenda
var calendar = CalendarApp.getCalendarsByName('tonya123456@gmail.com');
if(calendar == null){
//user may not have access, auto-subscribe them.
calendar = CalendarApp.subscribeToCalendar('tonya123456@gmail.com',
{hidden:true,selected:false});
}
Logger.log('This user owns or is subscribed to %s calendars.',
calendar.length);
我知道的一种方法是列出所有你自己的事件,其中有一个你正在寻找的创建者。下面的函数将获取事件并返回与事件创建者匹配的事件ID数组。这不是一个包容性的解决方案,例如它没有日期范围或处理分页结果,只是实现这一点的一种简单方法 你会像这样使用它:
function myFunction(){
var IDs = getEventIdsByCreator(myCalendarId,"tonya123456@gmail.com")
}
function myFunction(){
var IDs = getEventIdsByCreator(myCalendarId,"tonya123456@gmail.com")
}