How to Detect if a Second Monitor Is Connected

Hi,

I am working some time now with KM and I love it more and more.

This week I set up a macro to open and position programs and their windows at special places.

What I now try is to first detect, if my second monitor is connected or not and depending on that I would like to place the program windows at different places.

My problem is that right now I could not figure out, how to test if the second monitor is connected or not.

I found different examples working with saying, place window at monitor 1 or 2, but not how to test, if the second one is available.

It would be great, if you can help me out to get this done. :pray:

KM provides a number is screen-related functions. Start by looking at the SCREENCOUNT() function documented in the wiki function:SCREENCOUNT [Keyboard Maestro Wiki]

Hopefully that’ll get you started!

1 Like