Please help to improve this palette macro

I created the macro below with the kind support of @Zabobon. What it does should be more or less self-explanatory. If not, I'll be happy to explain it.

Now, If possible I would like to add this.

  • If "4" is pressed and released within 0.2 s, then type "4".
  • If "4" is not pressed and released within 0.2 s, then type nothing.

Does anyone know how to do this? Thank you!

This is all getting very convoluted... but I think the below does what you want.

Note that you now have to have two Actions for each Palette you want to show/hide. One Action set to show the Palette and one Action set to hide the Palette. In the example Macro you would edit both Magenta Actions to point at your actual Palette.

If you press and hold "4" the Palette is shown until you release "4".

When the Palette is shown, the mouse cursor is moved to a certain position so that it can be on the Palette and restored to the where it was when the Palette is closed.

If you just tap "4" then the digit "4" is typed.

Of course it does break the golden rule of not using single letter hotkeys :roll_eyes:

Show Hide Palette or Type 4 if key just tapped.kmmacros (7.6 KB)

Click to Show Image of Macro

Show Hide Palette or Type 4 if key just tapped

2 Likes

Well, what can I say? It works PERFECTLY! You are my hero @Zabobon :champagne:

But what you notice well, everything is is a bit slower than with the simpler solution. This probably has to do with the fact that the macro has become much more complex. My poor Mac has to do some real work here. I have to get used to the delay until the palettes become visible. But it will be fine. :slightly_smiling_face:

This "system" is the best way to use palettes for me. "4" works like a modifier. And now also as a digit. :+1: The mouse goes to the palettes, so I can also use the mouse to trigger a macro. Who could want more? Everyone should use palette like this, you too :innocent:

Then I can only say many thanks again :smiley:

Edit // Ah, another question, where/how do I adjust this 0.2 s?

2 Likes

That is set in the Pause Action:

1 Like

0.1 is much better :slightly_smiling_face:

@Zabobon I've been using your macro long enough (since I use it every 3 minutes) to say for sure that it works excellently. It has already become an integral part of my daily routine. I can't thank you enough for it. :smiley:

Only one problem occurs occasionally. The shortcuts of the "Vivaldi Haupt" palette sometimes remain active even though the palette is not visible. To solve this, it is sufficient to tap "4".

Do you have an idea what could be the reason for this?

Since yesterday I hide this macro group twice. So far the error has not occurred again. Could this really help or do you think it is a coincidence?

And you have that Group set like this?

No, if I do this, this is what happens.

Let's say I am in the Finder. When I press "4" the global palette and the Finder palette open. Now I trigger something from the Finder palette and release "4" again. All is fine.

But now when I switch to Vivaldi, this palette is already open. Somehow it is opened in the background.

I solve the problem by setting all palettes to "show for one action".

edit // Otherwise "show for one action" has no meaning. The palettes stay open as long as I keep "4" pressed.

Could you take a screenshot of the how the Vivaldi Group is set up?

And just checking that you don't have any other "Vivaldi" Groups (maybe when you were testing) that are still active?

If the odd behaviour is only affecting the Vivaldi Group and none of the others it feels like there must be something different about the Vivaldi Group.

Yes, there are other Vivaldi groups, but none with the same name.

Do you mean this? Do not worry about the shortcut. After many tests, I am convinced that it does not matter. :slightly_smiling_face: I need it to trigger something in BTT. The other groups are also set up like this.

It could also be something with Vivladi itself. I notice that with BTT, which I know much better than KM. With Vivaldi it often needs a special workaroud.

Maybe the workaround in this case is to double hide the palette. :joy:

If that works then that is the way to go.

BTW - you don't need to have "Display when toggled" checked. What that option does is shows a heads-up display when the Macro Group is toggled off and on. It is there for groups that don't have Palettes so that you can have a visual indication of when their Macros are active.

1 Like

Let's wait and see if it works. And if not, not a big problem. The advantages of the "magic-4-system" are so much bigger than this small inconvenience. :smiley:

Ah, ok, thanks, I never knew what that was.