macOS Shortcuts 无法原生读取日历事件详情,因其日历类动作仅支持写入操作;需通过 AppleScript 查询日历并返回结构化数据(如 JSON),再由 Shortcuts 解析处理。

macOS Shortcuts 本身不能直接「读取」已有日历事件的详情,它缺乏原生的“查询日历”动作。但通过组合 AppleScript + Shortcuts 的桥接方式,可以稳定实现这一目标——本质是让 Shortcuts 调用一段能查日历的 AppleScript 脚本,并把结果传回 Shortcuts 处理。
为什么 Shortcuts 原生不支持读取日历?
Shortcuts 的「日历」类动作目前仅限写入(如添加、修改、删除事件),不提供「获取事件列表」「按条件筛选」「读取某事件的备注或地点」等读取能力。这是系统级限制,不是权限或设置问题。
可行路径:用 AppleScript 完成查询,Shortcuts 负责触发与解析
AppleScript 可以完整访问日历数据库,包括跨日历遍历、按时间/标题/备注等字段筛选、提取 location / description / URL / alarms 等全部属性。Shortcuts 只需做三件事:
- 运行 AppleScript(通过「运行脚本」动作,语言选 AppleScript)
- 接收脚本返回的文本结果(建议统一格式为 JSON 或制表符分隔)
- 用「文本」或「JSON」相关动作解析并展示/转发/存档
典型查询逻辑示例(AppleScript 片段)
比如要获取「今天所有未完成的会议」:
tell application "Calendar"
set todayStart to (current date) - (hours of (current date)) - (minutes of (current date))
set todayEnd to todayStart + days of (current date)
set eventList to {}
repeat with cal in calendars
try
tell calendar (name of cal) as string
set foundEvents to (every event whose start date ≥ todayStart and start date ≤ todayEnd and allday event is false)
repeat with e in foundEvents
set end of eventList to {
title:summary of e,
time:(time string of (start date of e)) & "–" & (time string of (end date of e)),
location:location of e,
notes:description of e
}
end repeat
end tell
end try
end repeat
return (eventList as text) -- 或用 do shell script "python3 -c 'import json; print(json.dumps(...))'" 输出 JSON
end tell实际使用建议
为避免每次手动改脚本,可让 Shortcuts 先获取「日期范围」或「关键词」,再拼接到 AppleScript 中执行。例如:
- 用「请求输入」让用户选“今天/明天/本周” → Shortcuts 计算对应起止时间 → 注入脚本
- 用「获取剪贴板」读取一段含会议名的文本 → 传给 AppleScript 做 summary contains 匹配
- 脚本返回结构化文本后,用「分割文本」+「获取字典值」提取关键字段,再发通知或存到备忘录


















