I am looking for ways of sorting my Reminders.app lists so that the order gets propagated to my various iCloud synced devices. I can do this manually, but it takes a very long time and quite tedious with multiple lists. I would like to be able to do this programmatically so I can run a script to get all my lists sorted by priority. I have tried multiple things and still don't have anything that works.
Manual Method:
On macOS, go to reminders list, select Priority
sort from the View menu, then drag a reminder to change the position causing all the reminders order to be set and the list is reverted to Manual
sort order. This works, however, it usually takes 1-2 minutes for the app to update all reminders if there are lots of reminders in the list, hence the desire to script this (15 lists x 2 minutes of waiting per list = 30+ minutes of mostly waiting around for a relatively simple task that should be able to be scripted).
Using Swift and EventKit: I asked during WWDC 2020 at a lab about doing this in Swift using Event Kit and was told this wasn't supported or available.
Using JXA or Apple Script: I have been able to create new reminders and move reminders using JXA and Apple Script, however, it appears that there are multiple bugs that get in the way. First, the move(to:)
command doesn't actually work (it appears to delete reminders), and while the duplicate(to:)
command similarly doesn't work, it does appear to work like the move(to:)
command should work, however, when moving tasks, their order doesn't appear to change, so it can't be used to even add tasks to a new list in any particular order.
Additional Caveats: I might be able to get things to work by completely re-creating tasks, however, this doesn't work as some tasks have attached links connected to email messages or web pages, and that data is not available to copy or access via scripting or even EventKit
(just like the manual order information).
Honestly, this is something that Apple should fix in the Reminders app, but if anyone knows how to use UI scripting in the meantime, I would greatly appreciate it! I have used JXA and Apple Script to sort the reminder list on macOS by using UI scripting to select the View
Menu, Sort
Menu, then Priority
, however, I have no idea how to "drag a row to another position" using UI scripting which would be the final piece to make this whole process scriptable. Surely this can be done with the accessibility options...