Show a Palette of Macros - Auto-Create and Populate

With tons of help from @Nige_S, we managed to get this going and I think it's pretty slick.

Usage:

Select some macros in a group and trigger this macro. It will create a - Show Palette macro at the top of the group, populated with the pre-selected macros and set to be triggered by § (under the Escape key):

CleanShot 2022-10-24 at 11.09.21

Download:

Show Palette of Macros - Create.kmmacros (85 KB)

Macro screenshot

11 Likes

I am trying to move the mouse after the palette is displayed.
Is that possible?

It is possible within a conflict palette, FYI.

Cheers,

I'm not sure I understand what you're asking.

The mouse is free to move after the palette appears. Are you asking if the mouse can be moved to the palette's location programmatically?

If so, it makes more sense to move the palette to the mouse instead. Here's an example of how that can work:

- Show Palette (Example).kmmacros (44 KB)

Macro screenshot

This palette is empty as I don't have your macros. Add some to test it.

The pause is there to make the palette move more visually seamless. You can adjust or remove it if need be.

It uses the following submacro:

Move Palette to Mouse (Submacro).kmmacros (50 KB)

Macro screenshot

If there's a snappier way to move the palette I'd love to know about it. As far as I can tell, the Manipulate a Window action doesn't recognise palettes as windows of the Keyboard Maestro Engine.

1 Like

Thank you @noisneil
Yes, I'd like to move the mouse programmatically.
Right... move the palette in respect to the mouse would work.
(or alter the position of the mouse in the macro)

The reason for this is: some of the palette's will have 10 items, others will have 20 items. Chances are in most cases I'll usually use the 1st, 2nd or 3rd option so I'd like to be able to 'dial in' where the mouse ends up on the palette and have it located on the usual choice/s.

I don't have time now, but later I'll 'break down' the parameter of %CurrentMouse% and alter it to make the x and y what I would want it to be, then pass that to the sub-routine.
I don't want to alter the sub-routine for obvious reasons.

All good, appreciate your time and expertise here, and on the forum in general!

1 Like

You could use the AppleScript above and add an action to move the mouse slightly, relative to its current position. This might be easier, although either option will work.

1 Like

I've spent time trying to 'set' the mouse to x + 50, and y -100 in relativity to where the mouse originally was and I can't get it.

I don't want to set it in the sub-routine because the I'll have to have different sub-routines for each palette. I'd like to be able to set a variable in the main macro.

I'm sure it's right in front of me.... erg....

Try these:

- Show Palette (Example).kmmacros (45 KB)

Macro screenshot

Move Palette to Mouse (Submacro).kmmacros (52 KB)

Macro screenshot

Set the mouse offset coordinates in the green action.

I'm sorry man, it's not working, I have adjusted the 'x,y' numbers in the green action.
No difference.
Sorry to bother you with this dribble.....

Check that the correct submacro is selected in the palette example macro and try disabling the pause.

1 Like

Thank you man, bingo, removing the pause did the trick...
I appreciate your time..

1 Like

Hi, @troy. If you still want to move the mouse to the palette, this macro and sub macro seem to do the trick.

2023-11-17: 14:36 UPDATE: macros removed from post. An improved version will be posted soon.

2023-11-17 22:16 UPDATE: See SUBMACRO: sm.𝗽𝗮𝗹𝗲𝘁𝘁𝗲⇾MoveMouseToPalette

Hey @_jims , thanx.
It's not seeing the palette window as the #1 window.
With 0,0 set for the move amount, the mouse is moving way away from the palette.

Weird, it works perfectly for me. I’m away for my computer now, but I’ll look at it later today.

What version of macOS and KM are you using? Model Mac?

2017 27" iMac, 18,3
14.1.1 / 11.0.1 - thanx man, no biggie really...

@troy, thanks for testing the submacro I sent via DM. I've posted a refined version here: SUBMACRO: sm.𝗽𝗮𝗹𝗲𝘁𝘁𝗲⇾MoveMouseToPalette