| name | macos-applescript-integration |
| description | Lightweight patterns for querying macOS apps (Calendar, Reminders, Contacts) via osascript without MCP servers. Trigger keywords: list calendars, show events, today's schedule, upcoming events, reminders, calendar events, osascript, AppleScript. |
| license | MIT |
| metadata | {"version":"1.0.0","hermes":{"tags":["macOS","AppleScript","osascript","Calendar","Reminders","Contacts"],"related_skills":["macos-mcp-integration"]}} |
macOS AppleScript integration
Quick, lightweight access to macOS app data via osascript — no setup required. For persistent integrations or write access, use macos-mcp-integration instead.
Calendar — today's events
osascript -e '
set today to current date
set hours of today to 0
set minutes of today to 0
set seconds of today to 0
set tomorrow to today + (1 * days)
tell application "Calendar"
set allEvents to {}
repeat with cal in calendars
set calName to name of cal
set evts to (every event of cal whose start date ≥ today and start date < tomorrow)
repeat with evt in evts
set end of allEvents to time string of start date of evt & " | " & summary of evt & " [" & calName & "]"
end repeat
end repeat
return allEvents
end tell
'
For week view: change tomorrow to today + (7 * days) and add date string to output.
Calendar — count events
osascript -e '
set today to current date
set hours of today to 0
set minutes of today to 0
set seconds of today to 0
set tomorrow to today + (1 * days)
tell application "Calendar"
set eventCount to 0
repeat with cal in calendars
set eventCount to eventCount + (count of (every event of cal whose start date ≥ today and start date < tomorrow))
end repeat
return eventCount
end tell
'
One-liners
osascript -e 'tell application "Calendar" to get name of every calendar'
osascript -e 'tell application "Reminders" to get name of every list'
osascript -e '
tell application "Reminders"
set incompleteReminders to {}
repeat with reminderList in every list
set listName to name of reminderList
set items to (every reminder of reminderList whose completed is false)
repeat with item in items
set end of incompleteReminders to (name of item) & " [" & listName & "]"
end repeat
end repeat
return incompleteReminders
end tell
'
osascript -e 'tell application "Contacts" to count every person'
Key rules
- Always zero out hours/minutes/seconds for day comparisons.
- Check count first for empty results — provide clear "no events scheduled" messaging.
- Use native osascript directly — no icalBuddy or external tools.
- For persistent integrations or write access, use
macos-mcp-integration instead.