Thankyou for the reply. My brevity was an attempt not to derail this thread with a detailed description of the specific macro, but as you asked, I'll explain.
It's a Stream Deck profile switching macro that I developed for use with Logic Pro plugins. I've been trying to make it easier for other people to implement, as I've received quite a few messages about it. One of the complications is the loop-breaking submacro.
- When a whitelisted plugin window is at the front, the macro triggers.
- It opens a blank app, which in turn triggers a Stream Deck profile for that plugin.
- Window focus momentarily switches to this blank app and then back to the plugin window in Logic Pro.
- The macro sees the plugin window again and re-triggers. This loops over and over without the Break Profile Loop submacro.
I tried the Semaphore Lock as you kindly described, but it doesn't prevent looping. That's ok because, despite its inelegance, my method does work reliably.