如何用AppleScript获取带UID的Mac日历应用列表?
解决MacOS日历AppleScript获取唯一标识符报错问题
你遇到的问题是因为Calendar的AppleScript接口里,日历的唯一标识符属性名为id,而非你代码里写的uid——访问不存在的属性自然会触发错误。
修正后的代码如下:
tell application "Calendar" set calendarList to {} repeat with aCalendar in calendars set end of calendarList to {id of aCalendar, name of aCalendar} end repeat return calendarList end tell
运行这段代码就能正常获取每个日历的唯一ID和名称,后续你可以用这个ID指定目标日历推送事件。
内容的提问来源于stack exchange,提问作者jeznag
相关产品推荐
相关产品推荐

