How to toggle 2 actions (not simple menu items)?

I have a Bear app FLOATING Note. The Note floats over all apps, so the actual Bear app is not in the foreground. The 2 actions below work individually.

  • the note window opens with a callback URL
  • the note in minimized with the window minimize KM action.

I want the keyboard shortcut which triggers this macro to toggle both actions. All conventional approaches using IF THEN ELSE and window conditions have failed because we are dealing with a floating window which is fickle.

I am looking for a way to straightforward toggle both actions, the same way you would use a pipe sign to toggle menu items

thanks in advance for your time and help

Hi!
Here's a way to set up a straightforward toggle:

Straightforward toggle DEMONSTRATION.kmmacros (5.6 KB)
(v11.0.2)

Macro image

2 Likes

WOW ! Superb. I also saved it to my action library. Thank you VERY much for your time and writing the macro. Have a nice day!

1 Like

I have used this technique before and find it interesting that if one uses if-then instead of switch, rapid triggering of the macro can result in unpredictable results, unless a semaphore lock is added to the start of the macro. I suppose this is simply because if-then is a lot slower than switch.

1 Like