Help with Hide/Show Apps when PS is running

I'm trying to create a macro that will hide all other apps when a second monitor is connected and Photoshop is at the front, then show them again with PS is not. I tried show/hide when Photoshop was at the front, and it didn't work, so I resorted to "select menu" to hide.

The hide portion works as expected but when I click out the apps stay hidden. In a perfect world, I'd like the app windows on the second monitor to hide, but I would be happy just getting it working. See below for what I have so far. Thanks in advance.

Pick the right triggers. Instead of "is active" and an expensive once-every-second triggering of a macro that will needlessly try and hide apps that are already hidden, use "Activates" and "Deactivates" to fire when Photoshop becomes, or stops being, the frontmost application.

I don't have PS on this machine so have used TextEdit -- change mentions of that to PS and you should be on your way.

Hide-Show Other Apps.kmmacros (4.2 KB)