I find a hidden feature in keyboard maestro, you can send typing text to any application, even some background applications can use this feature.
But you must select an application or front application now. Most of time, the application is the last one I switch. If there is a option “last applicaton” to send text, it will be more flexible.
Being able to name the app in a variable context would be much more flexible.
I like the idea, loading application programmingly is more powerful. But “activate a applications” can’t use variable too. Maybe the whole application type macro will add this feature one day.
It's true that the activate application actions can't use variables, but you can use variables to activate them:
In case this is not clear to all (it was not to me immediately), "sending" text to a "background app" is done using the Insert Text by Typing action (KM Wiki):
As a Workaround to Send to Last App, I found these set of Actions to work very fast, which pastes text into the last app and then returns to the app when the macro was executed: