1
votes

Trying to select List in Reminder App, to add a reminder. it gives error error "Reminders got an error: Can’t make {"BillsTo Pay"} into type integer." number -1700 from {"BillsTo Pay"} to integer I tried various solution, none works

Plz advise whts causing the issue, and any pointers to resolve. Tx in advance

tell application "Reminders"
set listNames to {}
repeat with aList in lists
    copy name of aList to end of listNames
end repeat

--get listNames

(*
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to ", "
set listNames to listNames as text
set AppleScript's text item delimiters to oldDelimiters
get listNames
*)
(*
repeat with x from 1 to (count listNames)
    try -- skip errors
        set item x of listNames to (item x of listNames as integer)
    end try
end repeat
*)
(*
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set listNames to listNames as list
set AppleScript's text item delimiters to oldDelimiters
*)

set myList to choose from list listNames with prompt "Select the list to add Reminder"

set newremin to (make new reminder in list myList with priority) is 1

end tell
1

1 Answers

1
votes

Change

in list myList

to

in list named myList

By the way, your first four lines are silly. Just say:

set listNames to (get name of every list)

Here's a nice formulation:

tell application "Reminders"
    set listNames to (get name of every list)
    set myList to choose from list listNames with prompt "Select the list to add Reminder"
    make new reminder in list named myList
    set name of result to "My Cool Reminder"
end tell