我试图检查OS X 10.11.5上的提醒是否完整,如果不是则显示对话框。这是我的代码:
tell application "Reminders" to set rems to reminders in default list
repeat with rem in rems
if completed of rem is false then display dialog "A reminder is incomplete."
end repeat
但是我总是遇到这个错误:
Can’t make |completed| of reminder id \"x-apple-reminder://E3FCE788-80E7-432C-845C-F3CF1A7CD6B1\" into type specifier."
我不知道为什么。我有什么可以做的吗?
答案 0 :(得分:1)
已完成是" 提醒"应用程序,因此您必须将代码放在tell application
块中,如下所示:
tell application "Reminders"
set rems to reminders in default list
repeat with rem in rems
if completed of rem is false then display dialog "A reminder is incomplete."
end repeat
end tell