Minimize all windows on current/main screen only. How?

According to this thread you are asking for something very difficult. The thread says, "there is no convenient way to determine what windows are open on a given screen."

However one possible alternate solution is to simply use the KM Find Image macro to click on the Minimize Window button for each app on a given screen. I'm having mixed success with this approach due to all the false positives, due to the fact that the minimize button can be either yellow or grey for the frontmost visible window. If I can get it to work reliably I'll post it here.

OKAY! I got it to work reliably. You will have to change the image wells. One more thing: some apps use custom colours on their title bar, (eg, Home) which means my macro will need to add a new Find Image for each new colour you have on your apps.

The reason I use the SECONDS() function is because the macOS GUI animation for "minimize window" may cause delays in being able to see the buttons. So it keeps trying until one second of not being able to find any windows passes.

EDIT: Minor change: in the above code, replace "all screens" with "main screen."

1 Like