4

I can't seem to figure out a way how to read recurrence settings of an CalendarEventSeries using Google Apps Script.

There is a setRecurrence method; I am looking for something like getRecurrence hoping it would return an EventRecurrence object representing the recurrence settings of an EventSeries.

Any ideas?


Why do I need this? I simply want to copy an event from one calendar to another, keeping the recurrence settings (if any).

Rubén
  • 34,714
  • 9
  • 70
  • 166
Bugs Bunny
  • 2,496
  • 1
  • 26
  • 32
  • Possible duplicate of [How can I copy (duplicate) a calendar event into another calendar using Google Script?](https://stackoverflow.com/questions/12497158/how-can-i-copy-duplicate-a-calendar-event-into-another-calendar-using-google-s) – Robert Columbia Jun 09 '18 at 05:45

1 Answers1

1

Try using the Calendar API instead of the builtin calendar library. The API exposes much more information.

https://developers.google.com/google-apps/calendar/v3/reference/events/instances

jfreake
  • 21
  • 2
  • Java, Python, PHP, Ruby ... I prefer using JavaScript and Google Apps Script as this includes variety of triggers for firing the script from the cloud. With Calendar API I would have to obtain my own server and set some sort of time trigger to fire the script (which is a lot more work), am I right? – Bugs Bunny Sep 25 '15 at 09:46
  • No...not at all. You need to enable the api service from "Resources>Advanced Google Service" (in the script editor), then go to the developer console and enable the Calendar API and you can use the API from within your google script. No Server/PHP/Ruby required. Also...refresh your script window after enabling these...sometimes the auto complete function doesn't kick in until a refresh. Once you have refreshed, in your editor, type "Calendar." (with a capital C and a period) and the available properties/methods will show up in the code hint dropdown. – jfreake Sep 25 '15 at 11:35
  • Alright, I enabled Calendar API in both script menu Resources... and from the Developer Console. I successfully ran the [JavaScipt Quickstart](https://developers.google.com/google-apps/calendar/quickstart/js) from my localhost; however I still have no idea how to run it from the documents cloud using Google Apps Script :-( – Bugs Bunny Sep 28 '15 at 18:24
  • This should help...Here is a quickstart page for using the API in google apps script: https://developers.google.com/apps-script/advanced/calendar – jfreake Sep 30 '15 at 11:37