We have two drone machines that run all the time recording concerts. I've written a script that runs at startup to warn of any crash (and turned on restart and automatic log in), but occasionally for some odd reason the computers just log out of the account. We don't get warnings, because there wasn't a crash. I basically need to know when any of these recording applications stop, either by sending a message from that machine, or have a macro on another machine that periodically checks to see who is logged on, and if these apps are running.
Hello! I don’t think there is any way to solve this with Keyboard Maestro because if the rest of the system and apps are being logged out, I expect that Keyboard Maestro and it’s engine would too.
However, one possible solution is Power Manager which specifically has a feature designed to run scripts on logout.
Kind of related: I would caution against trying to use a LogoutHook. That feature has been deprecated in macOS for a long time, but it has worked until fairly recently, so you might see references to it on the web.