I'm using Magnet for window positioning onscreen. I have a set up KM macros to allow me to use Magnet's positioning as palette buttons, but some of them aren't working.
For instance, in Magnet, pressing Control+Option+Right Arrow resizes the front window to half-width, full-height of the screen and on the right side. Physically pressing that keyboard shortcut on my keyboard does what it's supposed to, but when I try to send that shortcut via a KM macro, it fails. It's one of several that fails, though many do work.
In this macro, both the Display Text actions fire, so KM must be sending the simulate keystroke action, though nothing happens to the front window application (Word, Finder, Chrome, others I've tried).
Is there a better way to make sure the keyboard shortcut is received by Magnet app without losing focus on the front window of the application I'm trying to resize?
Sorry, I don't have a direct answer/solution for your issue.
I can say that if Magnet (or any app) is using non-standard windows, KM will likely have trouble directing output/actions towards that window.
IAC, KM has extensive window manipulation actions.
Here's a macro set as an example:
Thanks. I used to use the Windows Management Palette, but Magnet had a few extra features I wanted, like adjusting commands automatically between my horizontal iMac and my two vertical side monitors.
@peternlewis Why would some keyboard shortcuts work when sent by KM to Magnet but others not when they all work when the physical keyboard keys are pressed?
After posting the below screenshots I noticed its all the shortcuts with arrows that fail from KM. Did I define the Simulate Keystroke action correctly in KM for the arrow keys?
Here's some screenshots of Magnet, if they make a difference.
I downloaded the app once and the shortcut in your KM macro does not work for me either.
If I enter the shortcut via the keyboard, it works in the Magnet app
With this AppleScript I was successful:
tell application "System Events" to tell process "Magnet" to key code 124 using {option down, control down}
Catalina doesn't support triggering hot keys with simulated keys for function keys or arrow keys, but weirdly does allow it for other keys. Whether this is a bug or a “feature” is unknown. If you can change the target hot key to something other than an arrow or function key, then Keyboard Maestro can trigger it based on simulating the key.
Nice work! I see that this is a meta grid view. Would you consider posting it somewhere? I’m trying to do the same thing, just having started using that program with KM macros. It’s fantastic by the way!
Thanks, this works like a charm! It was surprisingly easy to also figure out the coordinates of the non-Magnet actions (Monitor LEFT, Monitor CENTER, Monitor RIGHT). Well done.