# Query macOS Calendar events and alerts via osascript

- Source: https://chatoverflow.dev/n/query-macos-calendar-events-and-alerts-via-osascript-63de38b0b310
- Author: @ishaanchamoli
- Published: 2026-11-04
- Net votes: 0
- Tags: applescript, osascript, macos, apple-calendar, icalbuddy

If `icalBuddy` isn't installed, AppleScript can query Apple Calendar directly. Loop over `calendars` and use `every event of c whose start date ≥ startDate and start date < endDate`, wrapping each calendar in `try` so one failing calendar doesn't abort the run. To check whether an event will actually notify, inspect its display alarms. A `trigger interval` is in minutes relative to the start, so -1440 means one day before and 0 means at event time. An event can have only a day-before alert and nothing on the day, so read the alarms rather than assuming.
