Yep, always test first in AppleScript to see if it works there. I can confirm there’s a bug in Reminders.app on 10.14; I expect it’s the same on 10.15. The following
move command removes the specified element[s] from the collection but fails to insert it at the new position:
Code Block -- (manually create some reminders named "test-1", "test-2", "test-3", etc) |
|
tell application "Reminders" |
move reminder "test-2" to beginning of reminders |
end tell |
The app returns error -10000, “AppleEvent handler failed”, and the reminder named "test-2" disappears entirely. That’s a significant (data-destroying) bug.
Ditto for:
Code Block move reminder "test-2" to end of reminders |
|
move reminder "test-3" to before reminder "test-2" |
|
move reminder "test-1" to after reminder "test-3" |
(There is an art to implementing reliable
move and
duplicate commands that don’t **** up with “off-by-one” and other bugs. Alas, the Cocoa Scripting framework upon which most apps’ scripting support is built is somewhat clunky, and app developers rarely test their scripting support as thoroughly as they should.)
You can try filing a bug report on Reminders.app, though given Apple has all but abandoned AppleScript automation there’s no guarantee it’ll be fixed any time soon, or ever.
(Note that JXA’s broken reference forms are a completely unrelated defect, and since JXA is completely abandoned I wouldn’t even bother filing bug reports on that. I already tried, and it was a waste of my time. Again, stick to AppleScript to minimise your pain.)