Can I test whether there are two external monitors or just 1?

I have a macro to randomly change my desktop image on each of my monitors separately. The problem is, when I use my iPad as a monitor, it takes second place and my normal external monitor takes #3, but when I remove my iPad, the normal external monitor takes 2nd place. That messes up my macro as I use portrait photos for my normal external monitor and landscape for the others. Is there a way to check if there are 3 monitors then process one if...then sequence but if there are 2 monitors it will process the ...else sequence?

There's a SCREENCOUNT function documented on the Wiki -- so use an "If Then Else" action testing against SCREENCOUNT() = 3.


Thanks, I think I can make my whole macro simpler now with that.

1 Like

Just a suggestion. I've already done this. See Desktop Images Macros.

WOW - KM SCREENCOUNT function is great.

Thanks for this info!

Perfect for laptop use when sometimes using 1 or 2 monitors.

I made a KM macro to position the window where I wanted it on my external monitor. This worked great. However became a problem when I used the MacBook without the external Monitor.

So now I have the same macro use the SCREENCOUNT function to check first if the monitor count = 1 or 2. Next I use if/then login to position the window accordingly.