用 AppleScript 从终端添加提醒事项
不打开 App,直接把带截止日期的任务插入“提醒事项”。
使用 `osascript` 执行 `make new reminder in list ... with properties {name:..., due date:...}` 创建提醒。
01命令
命令
$ osascript -e 'tell application "Reminders" to make new reminder in list "提醒事项" with properties {name:"归还图书", due date:date "2026年9月20日 上午10:00"}'02作用说明
提醒事项的 AppleScript 字典支持创建带名称、备注和截止日期的提醒,脚本可以自动添加后续任务——例如部署脚本结束后自动安排一次检查。日期字符串的写法必须匹配系统区域设置。
03风险
!注意: 首次使用会弹出权限提示;这样创建的提醒会立即进入所选列表并同步到其他设备;列表名称必须已存在且拼写完全一致。
04撤销
撤销
$ osascript -e 'tell application "Reminders" to delete (first reminder of list "提醒事项" whose name is "归还图书")'05来源
- Reminders User Guide for Mac依据: Apple’s Reminders app documentation
- osascript – Execute AppleScripts and OSA scripts依据: osascript runs AppleScript that can script the Reminders app
最后验证: 2026-09-18 · 分类: 系统与设置