Did anyone ever get in to these?
AutoKey (Linux): https://github.com/autokey/autokey
a desktop automation utility for Linux and X11
see maybe the wiki for some ideas of what it can do? https://github.com/autokey/autokey/wiki
AutoHotkey (Windows): https://www.autohotkey.com/
The ultimate automation scripting language for Windows.
see maybe features https://www.autohotkey.com/#keyfeatures
I’ve definitely used autohotkey many times over the years… Mostly for videogames IIRC.