GUI automation is a hard problem. I'm impressed by Hammerspoon (OS X) and its nontrivial examples in the basic docs:
miniblog.
Related Posts
I'm experimenting with Hammerspoon on macOS as an application switcher. `Option-Space F` is Firefox, `Option-Space E` is Emacs, etc.
The problem with `Alt-Tab` is that the order changes based on recency. I'm hoping that a repeatable command will be nicer to use.
I've been playing with Hammerspoon to speed up my workflow on macOS.
Setting up shortcuts to jump to my most used apps is really nice. Alt-Tab forces me to choose from a large list.