Help with Macro to Cycle Though Series of Palettes

In order to limit the number of shortcuts I have to remember and in addition to conflict palettes which I use, I tried writing a macro which would cycle through a series of less commonly used palettes, but the result is a disaster.

This is inspired by Better Touch Tool which just introduced action cycling in its latest update.

I would like to:

  • Cycle as in endless loop through a series of macro group palettes.
  • I would like the macro trigger keyboard shortcut to be the same as the keyboard shortcut to cycle through the macros. For example, Cmd F would trigger the macro and if repeated would cycle through the palettes.
  • If I press Escape, I would like to cancel the macro.

Thank you very much!

ZZ Test Display Macro Group Palette :hammer_and_wrench: .kmmacros|attachment (23.2 KB)

This is a very good idea. @ronald! Thanks to your tip, I have just set up a cycle action in BTT. Works perfectly.

Not exactly the same, but what I do with KM is this. I have global palettes and app specific ones. If they all have the same shortcut (multiple "show/hide macro group" in the same macro), the global ones always open, but the app specific ones of course only if the right app is in front.

So you really only have to remember one shortcut. :slightly_smiling_face:

I think I'd just have a global counter, with numbers representing each palette. When the hotkey is pressed, I'd increment the counter (looping back to 1 if it goes past the number of palettes I have), then I'd hide all the other palettes, and show the one for the global counter.

If you always want to start with Palette #1, then when the hotkey is pressed, see if any palettes are being shown. If not, then set the counter to 1, otherwise increment it.

Since you can't really put each palette in a variable, there would need to be some hard-coding of each palette, and it might be a little cluttered, but it would work.

PS: You actually could use variables for the palettes, but it would probably require some JXA or AS.

1 Like