figgycity50 figgycity50 - 4 months ago 12
AppleScript Question

Can’t make |completed| of reminder id "x-apple-reminder://..." into type specifier

I'm trying to check if a reminder is complete on OS X 10.11.5 and if it is not then to display a dialog. Here's my code:

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


However I always get this error:

Can’t make |completed| of reminder id \"x-apple-reminder://E3FCE788-80E7-432C-845C-F3CF1A7CD6B1\" into type specifier."


I don't know why. Is there anything I can do?

Answer

completed is a term of the "Reminders" application, so you must put the code in the tell application block, like this:

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
Comments