Calculate the age of a person and write it to the event's description in your birthday calendar using Google Apps Script
This script uses Google Apps Script to access one's Google Calendar and calculate the age on a person's birthday. In the best case you have a custom calendar where your birthdays are stored at. If not, uncomment line 20 and use the filter function at the bottom.
- Head to https://script.google.com/home/my and create a new project. Rename the existing file Code.gs to your liking and paste the code from calculateAge.gs.
- Paste your calendar ID in line 9 (you can find it in the Google Calendar Settings)
- Make sure to add the birth year of a person to the location field (or customize the script)
- Customize the message in line 36
- Hit run and see the messages appear in your calendar events for the current year!
- Create a trigger to run this every year to calculate the correct age
I can't get the original script to work, can someone help me find out what's wrong? It also seems like the debugging breakpoints nor logging work so I can't see what's happening on the inside:
The log just says it ran successfully but the calendar event didn't change.