I'm new to Automator and AppleScript, so, apologies in advance if this question is answered/stupid/obvious/impossible.
My organisation runs the Zoom app, I can't install Zoom plugins etc, but I want to be able to, externally from Zoom, monitor if I'm on a Zoom call or not, and run a shell command or similar (say, to toggle an "ON AIR" USB light).
I assume I can write an AppleScript that runs at startup, hidden from Dock etc, that loops listening for an application, then a window of that application, then perform the action, and continues looping checking for the existence of the window, once it is no longer found, performs another action. Is that the right way to approach this?
Also, note here that just having the Zoom application open doesn't mean we're on a call - when the call ends, most of the time people keep Zoom open. It's only the Zoom call window that gets closed. Luckily, whenever there is a Zoom call, it always seems to be in a window called "Zoom Meeting" and that doesn't change.
I'd prefer not to use any third-party software unless it's free and open source.
What's the best way to achieve this?
