Hello @JMichaelTX !
As a follow up to the above question, is there any action I could use to activate the application Current_App_Name ?
I can't find any app action which takes variables
thanks very much !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MACRO ERROR OCCURRED on 2021-08-19 12:55:59
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This info was pulled from the KM Engine Log for the
Last Macro error that occurred.
MACRO:
--------------------------------------------------------
TEST App to Variable then Show Variable
--------------------------------------------------------
Action Type: Use Variable to Set Application By Name
Action Name: Use Variable “CurrentApplication” to Set the Front Application by Name
ACTION ERROR: for variable CurrentApplication
KM Engine Log:
--------------------------------------------------------
Use Variable to Set Application By Name failed to for variable CurrentApplication In macro “TEST App to Variable then Show Variable” (while executing Use Variable “CurrentApplication” to Set the Front Application by Name
--------------------------------------------------------
Log File: ~/Library/Logs/Keyboard Maestro/Engine.log
I'm not sure how you ended up using %Application%Foreground% for your front application token, but that was the first problem; it presents a list of foreground applications rather than just the frontmost one. Try it in the Value Inspector (⌘6 in the KM editor):
As for the window name error, that was just a timing issue; the macro was trying to bring the window in the front app forward before that app was actually frontmost. You can resolve this by adding a generic pause in between the "Use Variable to set app" action and the "Bring window to front" action, or do something like this that pauses until the app in the variable is at the front: