Window management on multiple displays

You used:
image

To use the screen where the window is frontmost, use:
SCREENVISIBLE(Front,Left)

For details, see SCREEN function.

You will probably need a Repeat action to go through all screens to find which screen you are on, and which is the next screen. There is no next screen function.

Here is an example macro that will determine the Current and Next Screen Numbers. You can use those numbers to manipulate the FrontMost window as desired.

Questions?


Example Output

image


MACRO:   Get Next Screen [Example]


#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/5/8/587d2df567ae126e9ab6f99388d785ae89a85443.kmmacros">Get Next Screen [Example].kmmacros</a> (10.0 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---

### ReleaseNotes

Author.@JMichaelTX

**PURPOSE:**

* **Get Next Screen Number**

**HOW TO USE**

1. Select the Window that you want to manipulate
2. Trigger this macro
3. This macro will provide the Current and Next Screen Numbers
4. You can use it in your own macro to manipulate the FrontMost Window as you like.

**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.
.
2. **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.  😉
.
* 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.

**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.

---

![image|574x1713](upload://b8w6eyQ7wBEerIeoEkBYRCKk5tx.jpg)
2 Likes