Count attached screens

Hi,

I'd like to make an If Then where I calculate the amount of attached screens and act accordingly. Is there a way to find how many displays are connected to the computer?

1 Like

See here:

As macro:


Number of connected displays as condition <8F9C 200310T183037>.kmmacros (2.9 KB)

Thanks!!!

Yep, and you don't need a shell script.
See SCREENCOUNT function.

3 Likes

Great idea :smile:

Thanks, completely overlooked that.

1 Like

Sorry that I posted an unnecessarily complicated solution. Note to myself: Always check the pretty darn good KM Wiki before replying.

But, at least you (and me too) have learned a nice way to get the display count via shell :wink:

(If you hadn't asked, I never would have looked it up.)

1 Like

Thanks here too.

This answer is gold! I either have 1, 2, or 3 screens of various sizes attached depending on where I'm working from. Grabbing the screencount number will allow me to place and size windows correct.

eg 3 windows each taking 1/3rd of 50" UW display looks great, but the same thing on a 14" built-in screen doesn't look so good. :smiley:

Kudos!