With tons of help from @Nige_S, we managed to get this going and I think it's pretty slick.
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
Show Palette of Macros - Create.kmmacros (85 KB)
I am trying to move the mouse after the palette is displayed.
Is that possible?
It is possible within a conflict palette, FYI.
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)
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)
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.
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!
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.
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....
- Show Palette (Example).kmmacros (45 KB)
Move Palette to Mouse (Submacro).kmmacros (52 KB)
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.
Sorry to bother you with this dribble.....
Check that the correct submacro is selected in the palette example macro and try disabling the pause.
Thank you man, bingo, removing the pause did the trick...
I appreciate your time..
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