Ability to Automatically Accept Meeting Invites in Google Calendar
I have searched through galaxies of search results, forums, blogs, apps and chrome extensions looking for a way to set my Calendar to automatically accept new meeting invites, and decline any invite that conflicts with an existing appointment. But I have found nothing but dead ends every time.
So help me Jason Savard, you're my only hope.
After looking through almost every Google Calendar extension, your's appears to be the most fitting and the most capable of providing this feature. There has to be a way. And if anybody can do this, you can.

Comments
https://github.com/ClaudiaJ/gas-calendar-accept/blob/master/Code.gs
It wasn't obvious to me at first how to use Google App Scripts. Finally found this: https://www.google.com/script/start/
1) Create a new script
2) Copy and paste both the Code.gs file and AutoResponse.html into your project.
3) Go to File -> Project Properties and add a new Script Property named "Id" with your calendar ID as the value (usually your email address - you can find it in your calendar settings).
4) You should now be able to run the script by selecting "ProcessInvites" in the top menu under the "Select function" dropdown and then clicking the play button next to it (note: the play button is disabled until you select an item in the dropdown)
5) If things fail, you can debug yourself. I found the Logger helpful for this. You can view logs by selecting View -> Logs. For example, on line 46 I added this:
```
Logger.log('Found calendar for "' + calendarId + '"');
```
6) If everything works, you can create a trigger by going to Edit -> Current project's triggers and creating a new trigger to kick off your script.
Good luck
Thanks a ton for the explanation - it works great. This should be a default option.
Hey @Ryan Wheale @Alex S I have followed the instructions and run successfully, I have even added the Logger.log to check everything works as it should, however the event is still not automatically accepted. I see the script runs successfully without error but the event still is not accepted. I have attached a screenshot of my trigger. Any help would be greatly appreciated
Years on, I couldn't get the solution above to work, but Google Bard gave me this...
Create a new Script:
function autoAcceptMeetingInvites() {
// Get all upcoming events from your calendar
var calendarId = "MyCalendarID"; // Replace with your calendar ID if needed
var startDate = new Date();
startDate.setHours(0, 0, 0, 0);
var endDate = new Date();
endDate.setHours(23, 59, 59, 999);
var events = CalendarApp.getCalendarById(calendarId).getEvents(startDate, endDate);
// Filter events to only include meeting invites
var meetingInvites = events.filter(function(event) {
return event.getDescription().includes("Meeting invite");
});
// Accept each meeting invite
for (var i = 0; i < meetingInvites.length; i++) {
var event = meetingInvites[i];
event.markAccepted();
}
}
Create a trigger. Worked first time.