add macro > name the macro > new trigger > application trigger > select application XY > is active (or: ‘is running’) > (and that’s the point: there is no option for one time execution for these two conditions) > repeating every x secons/minutes/hours
add hotkey > e.g. ‘shift-6’
will execute the following action:
select or show a menu item > select menu in > application XY > menu title YZ > menu item ZZ
What is wrong with my macro or is there another way to execute a menu item in a running application > only once and not repeatedly?
Any help is highly appreciated - thanks in advance.
It sounds like you've inadvertently confused application conditions (https://wiki.keyboardmaestro.com/condition/Application) with application triggers. By setting your macro to an app trigger, which executes macros based on application status regardless of hotkey, you've basically told it to keep executing repeatedly as long as the app is frontmost (active) or simply running, which clearly isn't what you want.
Here are two possible ways you can set up a macro to only execute via a hotkey as long as an app is running:
Create a new macro group, or assign an existing one, to only be active while you are using the app in question (manual page: https://wiki.keyboardmaestro.com/Macro_Groups)
Example:
Use an If Then Else action (manual page: https://wiki.keyboardmaestro.com/action/If_Then_Else) to determine if the app in question is active or running before executing the "Select or Show Menu Item" action.
Example:
Thank you very much (!) for your kind, qualified and extraordinary detailed answer - wow
Even though it took quite some time until I understood, that not only the macro list in the middle of KM’s window have conditions or attributes on the rightside, but as well the macro groups on the left hand side.
I managed then to realize your first solution, and everything works fine now.
I will try on the next weekend to work out the second way as well.
I’m using KM for maybe 3 years now and still am surprised, how complex and powerfull it is.
Same here. I learn something new about KM almost every day. I know many others feel the same.
If one of the above posts solves your problem/question as originally stated, please check the “Solved” checkbox (click for details) at the bottom of that post.
Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.