It would take very little effort to put an LLM frontend on top of this, and yet they've not only abandoned applescript (or the underlying apple events) at a time when they could expose it to the masses, but have gone in the exact opposite direction with "Shortcuts".
Oh and the icing on the cake is that apple events can be sent over the network as well, and this infrastructure has existed since the early days of OSX.