You can do this kind of thing pretty easily in macOS via the Services menus, Shortcuts, etc - which can easily route GUI objects or text through shell scripts, APIs presented by apps, etc. It’s a far more powerful construct, presented in a fairly friendly way most users can access with minimal experience but extensible enough to do almost anything (I had Shortcuts to hit the PagerDuty API to ack an alert, open a shell to the alerting system or closest jump box, start a tab to the ticket tied to the alert with a template to track findings, another to capture my logs from that shell, attach them to the ticket, etc)