How to detect when a zoom meeting has ended?

I've been trying for a while to make a KM macro to quit the zoom app after I end a meeting, but it's not quite right.

The closest I got was basically: whenever the zoom activates, check if there's a window with the title "Zoom Meeting", or check for the screen sharing interface on the screen with an image search. If neither of these conditions is met, quit the app after confirmation. I couldn't debug why, but with this method there are a lot of false positives (it prompts me to quit while in a meeting).

Anyone have any better ideas? Thanks!

I don't use Zoom (I don't trust it) but if there are any "words" in the window which indicate that no call is currently in progress, you can use KM's OCR action to read those words (eg, once per second) and then send the appropriate keystroke(s) to terminate the app. I'm not sure if putting OCR into a loop like that would make your Zoom app sluggish. You would have to test it.

There are other ways to solve this. For example, when you said "after I end a meeting" please elaborate on how you "end a meeting" because it's possible that we could get a KM macro to detect when you "end a meeting" and then take action when you do that. But you didn't say how you "end a meeting" so I can't get more specific. Do you click on a hotkey? Do you use your mouse? Please elaborate.

Great questions! I don't think you can use OCR- there's a window with the title "Zoom Meeting" when in a meeting, unless you're sharing your screen. There isn't really a way I can think of to tell if you are not in a meeting either- just an absence of that window. (which, again, is also true when screen sharing).

There are two ways I can think of to end a meeting: clicking an "End" button, or the keystroke cmd-w. When you're the 'host' of a meeting there's always an additional step of clicking a confirmation button or the enter key. Maybe I could try to detect either of these actions and also check if the zoom app has focus, but detecting itself seems nontrivial...

What about something like this?

edit: Nevermind, It definitely needs more checking than that because it quits instantly when I open zoom :joy:

I usually end my meetings by just hitting Command-Q, it asks me for confirmation and then quits the app in a single step, so a macro might not be neccessary.

That's another tricky thing- when you just open the zoom app, you have no meeting going, so you have to not quit in that case!

And that's a good point- maybe I can just always train myself to end meetings by quitting... Would still be nice to not have to though :smile:

Well, that's a good point. So what you are asking for is a macro that doesn't close Zoom until after a call is made and then is closed. It's certainly possible.

Well, I don't have the app, so I can't test it. But if you are in a call, isn't your NAME under your window? You could use your name as a "call in progress detection mechanism." That should be able to validate if you are in a call.

Also, OCR is a little bit finicky, so you would probably want to code it this way (as I have done): "If a certain string (eg, your name) doesn't appear in multiple OCR actions of the window over a period of 10 seconds, then close the app."

Well, KM is especially good at intercepting hotkeys like "CMD-W". That would be easy to solve. It would also be possible (but much trickier) to get KM to detect when you use the mouse to click on the End button. If you want CMD-W to both close the call and close the app, that should be simple. Just create a macro that detects CMD-W in the Zoom using a hotkey trigger, app then sends the CMD-W key to the app, then waits a second, then closes the Zoom app. That should fix your problem half the time, and would get you in the habit of pressing CMD-W to close the call AND the app.

Almost- this would work great, except for when you are sharing your screen. Then your name is not visible anywhere unless you're hovering over your own video feed preview!

That's a great idea- similar to @Evan_Mangiamele's suggestion to just always use cmd-Q to end meetings. I'll probably go with one of these ideas, as I think detecting an ongoing meeting while screen sharing might not be possible / reliable.

I hate giving up, but maybe we are running out of good ideas.

Actually, I'm not out of ideas. There's another approach. You could take a "Find Image" of the entire Zoom app, (then convert the image to an MD5 hash) then check if three consecutive hashes over 15 seconds are the same value, then that means the Zoom app is no longer "moving" (no video, etc.) and you could close the app. I presume if there is no motion inside the Zoom app for 15 seconds, of any type, that means the app should be closed.

What works for me is a macro that wakes up every few minutes to see if Zoom is running in the background (and, as you've discovered, not screen-sharing, which acts as if it's running in the background). I already had such a macro that does other periodic "sanity checks", so I added the Zoom test to it. Thus, if I forget to quit Zoom after ending a meeting, I'll get an alert in a few minutes reminding me to do so. You might also send a note to the Zoom folks asking for a "Quit Zoom after ending meeting" option. They're constantly adding features and might be interested. Hell, the option might already have been added without either of us noticing. A related idea I haven't tried, but I think would work, would be a macro triggered whenever Zoom deactivates, again checking for screen-sharing, and providing that same type of reminder.

I have one more idea! Many apps start a subprocess when they do "something big." You can see a list of subprocesses by opening up a Terminal window and typing "ps -ax" both before and while a call is being made. If you can spot a new process, then you can use this fact to "poll" for the end of a Zoom call. This would work really well, if such a subprocess exists. But I have no way of knowing without installing Zoom myself.

Based on my experience with similar apps, I'd say there's a 50% chance it might create a subprocess that is associated with a Zoom call. So give it a try. If it's there, I can help you write a macro to close Zoom whenever a call ends. I've done this before with a different app, and it worked really well.

Wouldn't it be easier to write a macro that

  1. Had you "Leave"/"End" the meeting (I can't remember if Zoom has different options depending on whether you are hosting or not)
  2. Quit Zoom

Saves a lot of messing around with polling, delaying any "Quit" command in case you've just launched or are trying to change settings, handling different window titles, etc, etc. And would also let you leave "manually" for those times when you are meeting-hopping and don't want to waste time quitting and re-launching...