Skip to content

Automatically creates and deletes 15min appointments around changed Google Calendar events to allow for leeway

Notifications You must be signed in to change notification settings

martijnvanattekum/auto-blockers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Summary

Automatically creates and deletes 15min appointments around changed Google Calendar events to allow for leeway

Description

The trigger script searches for changed Calendar appointments and determines which were added and removed. Next, blockers are added before and after the added events and removed from the removed events (unless the blocker is adjacent to another appointment, in which case it is kept).

A syncToken is kept in a separate sheet to keep track of the Calendar state and allow for incremental updates.

Setup

  1. Create required files
    1. Create a new project at https://script.google.com/
    2. Create a new Google Sheet (to save calendar state) and note the hash ID (from the hyperlink)
  2. Update the script
    1. Activate the Google Calendar API Service under the Services menu (From the left menu in the Editor)
    2. Copy the script from the Code.gs file to your open script
    3. Enter the hash ID previously noted in this script as VARIABLES_SHEET_ID (quoted)
  3. Set up the script functionality
    1. Run the resetToken() function by selecting it from the dropdown menu and clicking run to write the intial syncToken to above mentioned sheet.
    2. Create a Calendar Upated trigger for whenUpdated() from the Triggers menu

Resources

About

Automatically creates and deletes 15min appointments around changed Google Calendar events to allow for leeway

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published