3

I have an use case where I want to move certain reminders I created using Siri from the default list to another. Programmatically, via an AppleScript script, which runs on a Mac.

tell application "Reminders"
    set output to ""
    set inBoxList to "Erinnerungen"
    set newList to "Ausgaben"
    show list newList -- this works
    if (count of (reminders in list inBoxList whose completed is false)) > 0 then
        set todoList to reminders in list inBoxList whose completed is false
        repeat with itemNum from 1 to (count of (reminders in list inBoxList whose completed is false))
            set reminderObj to item itemNum of todoList
            set nameObj to name of reminderObj
            set idText to id of reminderObj
            if (nameObj contains "€" or nameObj contains " Euro ") then
                set output to output & "• " & nameObj
                set completed of reminderObj to "no"
                set container of reminderObj to list "Ausgaben" -- this doesn't
            end if
        end repeat
    end if
    return output
end tell

It's the following line that doesn't work:

set container of reminderObj to list "Ausgaben" -- this doesn't

I've tried variations like

set newList to list "Ausgaben"
set container of reminderObj to newList

but I always get an error that boils down that I can't set the container because it's not f the correct type list.

2

You can't change the container, because this property is read only --> container (list, r/o) : r/o means read only

But you can use the move command

tell application "Reminders"
    set output to ""
    set newList to list "Ausgaben"
    show newList
    repeat with thisReminder in (get reminders in list "Erinnerungen" whose completed is false)
        set nameObj to name of thisReminder
        if (nameObj contains "€" or nameObj contains " Euro ") then
            set output to output & "• " & nameObj
            move thisReminder to newList
        end if
    end repeat
    return output
end tell
  • Wow. Now I feel stupid. In my defense, “move” isn't listed in the Reminders Suite, but I should have gotten r/o even w/out a legend - which the library seems to lack. Anyway, many thanks, it now works exactly as intended. – Peter Brülls Jun 5 '15 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .