Macro in the background / Two macros in different apps

Hello there!

Is there a way to run a macro in the background or run 2 macros at the same time in different apps?

Yes. This happens automatically.

Depending on the app, it (the app) does not have to be frontmost for a KM macro to interact with it. For example, I can have a macro with a Set Variable Action, that set’s the variable to the current Safari page title, or URL, using the tokens %SafariTitle% or %SafariURL%, while Safari is NOT frontmost.

You, or your system events, can trigger multiple macros so that they are all running at the same time.

If you need more info, please provide your specific manual workflow that you want to automate, where you have this concern.

For example:
I have a macro which pastes 3 last items from clipboard to excel and fills the document. I’d like to keep working (doing something else) while the process is running, but have no idea how to do it.

You can’t paste into background apps, and you can’t have Keyboard Maestro control the UI while you also control the UI and expect a good result.

The only case where this would work would be if you were using Keyboard Maestro to control the Mac without actually controlling the UI, such as via AppleScript, or running shell scripts, or such.

You might try an AppleScript which will get the clipboard, but then use Excel commands to set the cells, rather than do a paste. If you do a search here for Excel you should find some examples of doing this.

Generally speaking, AppleScript can control an app that is in the background, as long as it is not using an UI commands, like copy/paste, or keyboard shortcuts.

Thank you for the answers, will look into Applescript.