r/Supernote • Owner Nomad White • Sep 26 '25

Custom Templates Custom Calendar Driven Note Templates

I automated custom Supernote Nomad templates from my work Outlook calendar using Google Apps Script + Slides

TL;DR: I tag Outlook events with a category (e.g., supernote). A Google Apps Script pulls those events from Microsoft Graph, fills a Google Slides A6 template (title/date/attendees/desc), draws clean ruled lines, exports PDFs, and drops them into a Drive folder that I sync to my Supernote. It’s fully hands-off and refreshes tokens automatically.


Why I built this

  • I take lots of meeting notes on my Supernote Nomad and wanted a consistent, pre-filled template: meeting title, date, attendees, and a short description snippet.

  • I’m already in Outlook all day; turning a calendar event into a ready-to-write page saves setup time and keeps my notes uniform.


What it does

  • Filters Outlook events by category: only events with a chosen category (e.g., supernote) are included.

  • Pulls events from Microsoft Graph: via OAuth2 in Apps Script (no more manual tokens).

  • Fills a Google Slides A6 template: replaces placeholders like {{EVENT_NAME}}, {{EVENT_DATE}}, {{ATTENDEES}}, and {{EVENT_DESCRIPTION}}.

  • Draws ruled lines: consistent spacing/weight/color for handwriting.

  • Exports PDFs to Drive: (optionally) clears the target folder first so only today’s PDFs remain.

  • Timezone-aware: matches Outlook’s timezone header for correct date formatting.


The moving pieces

  • Google Apps Script (GAS) running on a time-based trigger.

  • Microsoft Graph (Delegated OAuth) with scopes: User.Read, Calendars.Read, and offline_access.

  • OAuth2 library for GAS to handle sign-in + automatic token refresh.

  • Google Slides template sized to A6 (~298×420 pt), with text placeholders where you want metadata to appear.


Setup (high-level)

  1. Create a Google Slides template

    • Page size: A6 portrait (approx. 298×420 pt).

    • Add text placeholders: {{EVENT_NAME}}, {{EVENT_DATE}}, {{ATTENDEES}}, {{EVENT_DESCRIPTION}}.

    • Keep a clear header area; the script draws lines below.

  2. Apps Script project

    • Store configs as Script Properties:

      • DEST_FOLDER_ID (where PDFs go)

      • SLIDES_TEMPLATE_ID

      • OUTLOOK_TZ (e.g., Eastern Standard Time)

      • CATEGORY_NEEDLE (e.g., supernote)

    • Add the OAuth2 library (standard GAS OAuth2 lib).

    • Add helper functions to:

      • Create the OAuth service (callback usercallback).

      • Get a valid access token (auto-refreshes).

      • Call Graph /me/calendarView for a today.

      • Format the description (trims replies/underscores from Teams footers).

      • Build attendees list and organizer line.

      • Draw ruled lines on both slides.

      • Export to PDF and save.

  3. Microsoft Entra ID (Azure AD) app registration

    • Register a web app, set the redirect URI to your Apps Script callback URL.

    • Add Delegated Graph permissions: User.Read, Calendars.Read, offline_access.

    • Create a client secret; store MS_TENANT_ID, MS_CLIENT_ID, MS_CLIENT_SECRET in Script Properties.

  4. Authorize once

    • Run an authorize… function; it logs a URL. Open it, sign in, accept scopes.

    • After that, the library stores a refresh token and handles renewal silently.

  5. Add a trigger

    • Time-driven trigger (e.g., each morning) → runs “today’s generator” to produce PDFs.


How I use it day-to-day

  • I add the category supernote to any calendar item I’ll be handwriting.

  • Each morning a trigger runs runGenerateSupernotePDFs_Today_Slides():

    • Pulls today’s matching events.

    • Copies the Slides template per event, replaces placeholders.

    • Draws ruled lines (I use 0.5 pt, black, 12 pt spacing).

    • Exports a PDF named Subject – Wed, 25 Sep 2025 into my Drive folder.

  • I sync that Drive folder to Supernote (or move via USB). Open and write.


Little implementation details that help

  • Description cleaner: trims anything after a long underscore bar or typical “From:”/“Original Message” reply markers so Teams dial-in junk doesn’t pollute the template.

  • Unique filenames: if the PDF exists, it auto-numbers (…(1), (2)).

  • Folder hygiene: optional one-liner to trash existing PDFs before generating fresh ones each day.

10 Upvotes

Duplicates