From 96536f3c86f61b182ddff4c1f628fb8dcebbc5fb Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Fri, 13 Feb 2026 13:24:12 -0500 Subject: [PATCH] Auto-sync: 2026-02-13 13:24:12 --- skills/macos-calendar/SKILL.md | 8 ++++ skills/macos-calendar/fetch_events.scpt | 57 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 skills/macos-calendar/SKILL.md create mode 100644 skills/macos-calendar/fetch_events.scpt diff --git a/skills/macos-calendar/SKILL.md b/skills/macos-calendar/SKILL.md new file mode 100644 index 0000000..306f58a --- /dev/null +++ b/skills/macos-calendar/SKILL.md @@ -0,0 +1,8 @@ +# macOS Calendar +Description: Manage calendar events via the macOS Calendar app using AppleScript. + +## Tools + +### list +Description: List calendar events for the next N days (default 7). +Command: osascript skills/macos-calendar/fetch_events.scpt {{days}} diff --git a/skills/macos-calendar/fetch_events.scpt b/skills/macos-calendar/fetch_events.scpt new file mode 100644 index 0000000..fc6d718 --- /dev/null +++ b/skills/macos-calendar/fetch_events.scpt @@ -0,0 +1,57 @@ +#!/usr/bin/osascript +on run argv + set daysToFetch to 7 + if (count of argv) > 0 then + set daysToFetch to (item 1 of argv) as integer + end if + + set currentDate to current date + set endDate to currentDate + (daysToFetch * days) + + tell application "Calendar" + set output to "" + set allCalendars to calendars + + repeat with aCal in allCalendars + set calName to name of aCal + -- Filter out holidays or subscription calendars if they are too noisy, but for now keep all. + + set calEvents to (every event of aCal whose start date is greater than or equal to currentDate and start date is less than or equal to endDate) + + repeat with anEvent in calEvents + try + set evtSummary to summary of anEvent + on error + set evtSummary to "No Title" + end try + + try + set evtStart to start date of anEvent + on error + set evtStart to "Unknown" + end try + + try + set evtEnd to end date of anEvent + on error + set evtEnd to "Unknown" + end try + + try + set evtLoc to location of anEvent + if evtLoc is missing value then set evtLoc to "" + on error + set evtLoc to "" + end try + + set output to output & "Calendar: " & calName & "\nEvent: " & evtSummary & "\nStart: " & evtStart & "\nEnd: " & evtEnd & "\nLocation: " & evtLoc & "\n---\n" + end repeat + end repeat + + if output is "" then + return "No events found for the next " & daysToFetch & " days." + else + return output + end if + end tell +end run \ No newline at end of file