Auto-sync: 2026-02-13 13:24:12

This commit is contained in:
Adolfo Reyna
2026-02-13 13:24:12 -05:00
parent b3146f1431
commit 96536f3c86
2 changed files with 65 additions and 0 deletions

View File

@@ -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