Recognize external webcam; change videoconference preferences

I’m fairly new to Keyboard Maestro, and am hoping someone here can help me figure out how to solve the following problem. My primary computer is a 13" MBP (late summer 2013), and when I’m at work I generally keep it connected to an external monitor. When at home, no external monitor.

I use a videoconferencing app called Zoom quite a bit. When I start Zoom it automatically defaults to the laptop webcam. What I’d like to do is create some way for the computer to detect that:

Zoom is running AND an external monitor (or external webcam) is present

and when both those conditions are met, configure the settings in Zoom to default to the external display’s webcam.

Not sure how to do this, and I’m hoping there’s a way to do it without writing a script (since that is something I have yet to learn how to do!)

Thanks for any suggestions you might have,
Fran

You can trigger a macro when Zoom is launched. And that macro can check the SCREENCOUNT() to see how many screens there are.

How do you do this manually?

Thanks for the tip about SCREENCOUNT()

When I launch Zoom and begin a meeting, I open the Zoom preferences, select the video panel in preferences, and then select the external display webcam. I have two offices, so of course two different setups - in one case, a Thunderbird display with a built-in webcam, in the other, a webcam sitting atop a second display.

In both situations, though, the screencount would be two rather than one, and the change is made to the settings in Zoom - so if I can solve for one it should be easy to solve for the other (I hope?)

thanks,
Fran

If the screens are different sizes or positions, then you can use the SCREEN function to detect the difference.

If there is no other way to configure Zoom, then you would need to control the UI exactly as you control it manually:

  • Select Menu Zoom -> Preferences… (or Command-, probably).
  • Pause for the window to open
  • Select the appropriate choice.
  • Close the window.

If I understand you correctly I believe you could also use the name of the WiFi connection to decide the difference - If the two offices are in different buildings.

I have built below macro to decide what (known) wifi I'm on and save a predefined name for the wifi in a variable (home, work, summer house etc.) This way I can call the variable in other macros and make them do different stuff depending on where I am.

can I use SCREEN (External) to tell if there is an external monitor connected? Often when using an external display I close the laptop - so SCREENCOUNT is still 1. Thus I need a way to tell whether the screen is the internal or external display.

You should be able to use the calculation test in an If Then Else action, something like:

SCREEN(External,Width) = 0

got it! perhaps clunky, but it's working. Thank you for your help - could not have done it alone!

Fran