0
我想创建一个脚本,所以当我在一个谷歌日历中创建一个事件它会自动复制另一个谷歌日历中的事件。我曾尝试使用下面的代码尝试(换日历的ID与我自己的 - 假设我使用完整的ID例如[email protected]等):谷歌脚本重复新的谷歌日历事件到另一个日历
function myFunction() {
var calendarSource = CalendarApp.getCalendarById("calendarID");
var calendarDestination = CalendarApp.getCalendarById("calendarID");
var eventToCopy = calendarSource.getEvents(new Date("July 21, 2009 EST"), new Date("July 22, 2009 EST"));
//read up: https://developers.google.com/apps-script/class_recurrence
var newRecurrence = CalendarApp.newRecurrence().addWeeklyRule().times(10);
for (var i in eventToCopy){
if (eventToCopy[i].getTitle() == "event name"){
var newEvent = calendarDestination.createEventSeries(eventToCopy[i].getTitle(), eventToCopy[i].getStartTime(), eventToCopy[i].getEndTime(), newRecurrence);
}
}
似乎没有任何虽然发生。任何人都给我一个头马?我只想要这个触发创建一个新事件。
可能重复[我怎样才能复制(复制)的日历事件将使用谷歌脚本再历?](http://stackoverflow.com/questions/12497158/how-can-i-copy-duplicate -a-日历事件 - 进入 - 使用另一个历-谷歌-S) – Mogsdad 2014-11-05 01:40:54