autmating using python scripts from Autokey

automating apps

WM : using python scripts with keyboard.send_key from AutoKey is not recommended,
because all sorts of of weird shit happens

that is probably related to the keypress food chain.
When you press keys, a lot goes on. Sometimes, parts of the system see and consume them before AutoKey ever gets to see them.
AutoKey creates the keypresses, but the receiving application can be expecting keypresses to be generated in another form and ignores them.

is true for other tools as well :

Sending keystrokes to a specific window uses a different API than simply typing to the active window.
If you ‘xdotool type –window 12345 hello’
xdotool will generate key events and send them directly to window 12345.
However, X11 servers will set a special flag on all events generated in this way
(see XEvent.xany.send_event in X11’s manual).
Many programs observe this flag and reject these events.