How Can I Resize All Windows on the Primary Monitor to Provide a Margin on the Right Side?

Hello, your script work like charm , is there any chance to change this script to: change all primary monitor windows size -> to see desktop right column of icons ? Iam realy new to this. Many thanks for your advice if possible. Mirek D.

I'm not sure what you are asking. Do you mean you want to resize all of the windows so that an area on the right of the main screen is visible?

hello, thank you very much for your reply.
Goal is. on the main monitor from four of total , I would like to shrink all visible applications so that a column of icons is visible. So if you work on main screen (some app full screen ) and make printscreen- shrink all main screen Applications - you can see part of the desktop.

Many thanks

Based on our conversation, and just to clarify, you are wanting the following:-

All the windows on the primary screen (ignore any on other screens) to be shrunk down by 80% width , reduced in height, and placed on top of each other nearly at the bottom left hand corner of the primary screen, so that you can then see the dock (at the bottom of the screen) and the icons (on the right hand side of the screen)
All shrinked windows may get same size and position.

let me thank you for the exact summary and yes this would be great

@Mirek_Dvorak, could you please post before and after screen shots, showing what you are starting with, and what you want to achieve.

@Mirek_Dvorak, how does this look? Is this what you are expecting? Or something else?

Screenshot of my iMac-27 Monitor:

hello many Thanks for your reply, Before - some apps on primary may be fullscreen, after macro - left column of icon is visible.

Thanks. This is very helpful.
Is the resulting layout I show above acceptable to you?

Here is the criteria I used:

  1. Resize width to be current size, or 80% of screen, which ever is smallest.
  2. Resize height to a fixed size (which you could specify), knowing that some apps have an internal min size which will prevail.
  3. Reposition starting at lower left corner of visible screen (which would account for a visible Dock)
  4. Add a fixed offset (which you could specify) to cascade each window above and to the right of the prior window, making sure rule #1 is met.

The reason that I cascade is so that you can see ALL windows after the update.

Please let me know if that is OK.

Hello many thanks for your help, cascade is nice, but not necessary for me, i Need to see just 1 column of primary monitor desktop icons. all visible apps shrink to 80-90 percent and resize them if neccessary.

solution as you describe will help as well - what Iam looking for is make as litlle changes to layout as necessary.

Mirek D.

OK, so all you really want is to reduce the width, if necessary, to make the desktop visible for a section on the right-hand side, correct? That is very easy.

One thing I'd suggest is to choose an actual number of pixels you want as margin on the right, rather than as a percent of screen, since the user's screen size can vary widely.

Since your question is really quite different from the Macro topic, I have moved it and all replies to a new topic.

OK, so all you really want is to reduce the width, if necessary, to make the desktop visible for a section on the right-hand side, correct?
YES :smiley:

One thing I'd suggest is to choose an actual number of pixels you want as margin on the right, rather than as a percent of screen, since the user's screen size can vary widely.
150PX

1 Like

OK, try this and let us know if it works for you.

Like most things, it turned out to be a bit harder than I originally thought.
Handling the normal windows was easy, but it was trick handling full screen and partially off-screen windows.

Note that this macro processes the windows on the FRONT MOST Active Screen.
If you only have one screen that would be it.
If you have multiple screens, then just activate any window on the Screen where you want the resizing done.

Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.

Please let us know if it meets your needs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Resize All Windows for All Apps on Front Screen to Provide Margin [Example]

-~~~ VER: 2.0    2020-07-03 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Resize All Windows for All Apps on Front Screen to Provide Margin [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Resize (If Needed) All Windows in Front Screen to Provide Visible Right Margin on Desktop

TAGS: @WinTag @Windows @Resize @Move

HOW TO USE

  • First be sure to follow instructions in Macro Setup below.
  • Activate any Window in the Screen/Monitor that You Want to Resize Windows for
  • Trigger this Macro.

NOTICE: This macro/script is just an Example

  • It is provided only for educational purposes, and may not be suitable for any specific purpose.
  • It has had very limited testing.
  • You need to test further before using in a production environment.
  • It does not have extensive error checking/handling.
  • It may not be complete. It is provided as an example to show you one approach to solving a problem.

REQUIRES:

  1. KM 8.0.2+
  • But it can be written in KM 7.3.1+
  • It is KM8 specific just because some of the Actions have changed to make things simpler, but equivalent Actions are available in KM 7.3.1.
    .
  1. macOS 10.11.6 (El Capitan)
  • KM 8 Requires Yosemite or later, so this macro will probably run on Yosemite, but I make no guarantees. :wink:

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. :wink:
      .
  • Assign a Trigger to this maro.
  • Move this macro to a Macro Group that is only Active when you need this Macro.
  • ENABLE this Macro.
    .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    • ALL Actions that are shown in the magenta color
      • Set Right Margin in Pixels
      • Set Variable “Local__SF” to Text “%ScreenVisible%Front%”
        • You can use "Main" instead of "Front" to target you Mac's Main Screen

USE AT YOUR OWN RISK

  • While I have given this limited testing, and to the best of my knowledge it will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

It works :smiley: If I may - Is it possible leave inactive apps intact all apps which not cover that right column space ? Right now this macro run through all of them :smiley:
many thanks

Sorry, I don't have any more time now. But you should be able to fine tune the macro to meet your needs. Just look at the formula I use to determine if the window is in the Screen and add further IF/THEN to determine if it needs adjusting or now.

Many thanks anyway - is there any way how to refund your time? because this helps me a lot