Select all instances of open windows for specific application and move to one monitor

Hello,

I have a Macbook Pro and 2 external monitors. While working, I frequently run into situations where I have several instances of an application open in different windows and scattered across multiple monitors.

What I am trying to do is create a macro that will focus on all instances of an application and consolidate them to one monitor. Is this possible?

Thanks for your consideration.

1 Like

You can use the For Each action with the Number Range collection from 1 to WINDOWCOUNT() and the Manipulate a Window action to move the indexed window to center it on the desired screen using the SCREENVISIBLE functions.

2 Likes

Thank you! I will toy with this for a bit.

This looks promising. How would you create a collection of Windows for a specific application?

For my use case, I want to loop through Firefox’s Windows and move them to another monitor.

The link you shared references a collection called “The numbers” which isn’t an option in my collections pulldown menu. My guess is that I need to create a collection somehow.

The Collection is from 1 to Firefox's WINDOWCOUNT(), so that the "For Each" Action moves the Firefox window with the index 1, then the window with the index 2, and so on.

Here's a macro that "cascades" Firefox windows on the primary display. In this case the "For Each" runs backwards so that the backmost window ends up top-left at the back of the cascade and the frontmost is bottom-right and in full view:

Firefox Window Cascade.kmmacros (5.0 KB)

Image