Macro to drag window to the next monitor in Mac

Hi folks,

I recently started playing around with Macros, and I love it! I have been thinking of using some macros to workaround pain points in MacOS. For instance I’d live to move a full-screen app (say Chrome) from one Monitor to another (i.e move from one “Space” to another). Unfortunately there’s no keyboard shortcut as of now.

Currently I do it with this:

  1. Middle click (Mission Control in MacOS opens up on all Screens, and top of the screen shows the current “Spaces”. My full screen Chrome would be occupying one of those)
  2. Click on the app I want and drag it to the Screen I want (Yay Mouse Layer!)

I tried to replicate this with Macro, but realized that usually I visually figure out where the current app is, on the Mission Control view (as in, it can be the first, second or Nth Space), choose it, and then drag it.
Not sure how I can work around that bit with a Macro.
Any ideas?

Thank you!

Kind of started on it with this:

I am not sure if this is intended behaviour, but I think UHK Macro doesn’t allow me to drag things across 2 screens. For instance, I tried to click on a Folder and drag it to the next desktop (screen in MacOS parlance), but the Folder icon won’t move past the current screen. Interesting.

Found a hack for this (at least on MacOS)

image

Keyboard Shortcuts → App Shortcuts → All Applications → add the above
Note: This has to match the Window menu bar list item EXACTLY. Or it won’t work.

Then I mapped this to an easy-to-use Macro on my Fn layer.

image

Seems too ugly though. Wonder if there’s a more elegant way to do this!

What is ugly about using a window manager shortcut for the thing that it’s designed for?

That’s exactly the right way to do that.

Ugly would be using the above “mouse drag” macro.

2 Likes

Issue is, this doesn’t work for all cases. All apps’ Window menu don’t have the Move to foo option. For instance UHK-Agent doesn’t have it.
More importantly, none of the JetBrains IDEs (IntelliJ, PyCharm, GoLand are the ones I have checked), don’t have it.
So for them I haven’t solved it.
Seems more like a MacOS limitation though. I’m sure *nix has better window management.

Ah, I see :anguished:.

Found a solution which works for all cases. Needs this app - Rectangle
There’s a free version: https://rectangleapp.com/

It has neat shortcuts for a lot of common things, my current setup:

Can map a few of these to a few macros on Fn layer, and Profit. :smile:

2 Likes

I use yabai for window management and skhd for keyboard shortcuts. These should do everything you need.