Trigger Different Action with Second Run of a Key Command

Continuing the discussion from Select All and Copy:[quote=“peternlewis, post:4, topic:4273”]
By the way, a variant I did of this was for a Copy to Markdown macro, where pressing the trigger a second time copied it in a different style. It did this simply by:

set variable First to whatever the first style is
set variable Second to whatever the second style is
if clipboard is not Firstset clipboard to First

elseset clipboard to Second
[/quote]

I searched the forum but could anyone post some other similar macros that do something different the second time the macro is run. I am not sure I follow how this would work since it would need some sort of timeout function built into it to know when to start over as the first time the command is run.

I would ideally like to run a command with a long press like Tom shows to initially set a number value and then each time after the command is run with a short press have the value increment by one value like Dan shows in this macro

Here is an example of what I do in my Copy Link as Markdown macro. It has three different formats, which I store in variables Out1, Out2, and Out3 (they are each based on variables Name, Link and Extra, but how you set them up is not germane to the topic). After that, I test if the clipboard is Out1, and if so set it to Out2, or instead if it is Out2, I set it to Out3, and failing that I set it to Out1.

Keyboard Maestro Actions.kmactions (3.5 KB)

Thank you Peter that is helpful to learn from.

See:

2 Likes

Thank you @JMichaelTX for the link and macro, this has been helpful in a macro I use with Nuendo.

1 Like