I don't know why, but the approach where "agents" accomplish things by using a mouse and keyboard and looking at pixels always seemed off to me. I understand that in theory it's more flexible, but I always imagined some sort of standard, where apps and services can expose a set of pre-approved actions on the user's behalf. And the user can add/revoke privileges from agents at any point. Kind of like OAuth scopes. Ima…
OS specific, but Apple has the Scripting Support API [0] and Shortcut API for their app. Works great.
[0]: https://developer.apple.com/documentation/foundation/scripti...