Auto-close a "ghost" popup window after unlock/wake

Hi BTT community,

First of all, thank you for BTT — it’s an essential tool on my Mac and saves me so much time. :slightly_smiling_face:

I’m trying to solve an automation issue with a persistent popup and I’m hoping someone can point me in the right direction.

The Problem
Every time my Mac locks or sleeps, a specific application window pops up (see attached screenshot). It stays on the screen after unlocking, and I have to manually close it every single time.

image

What makes it tricky:

  • Targeting: The window does not appear in the Cmd + Tab app switcher or standard window switching, making it a bit of a "ghost" window.

  • Displays: I use multiple external monitors. Depending on the setup, the window appears on different screens. While it usually stays in the same relative position for a specific configuration, a fixed mouse-click action won't work because the coordinates change when I add/remove monitors.

  • Closing: Interestingly, Cmd + W does not work on this window even when it's focused. However, pressing the ESC key works perfectly to dismiss it.

What I have tried:

  • I have a trigger for "Screen Unlocked" working correctly.

  • The window is usually already focused immediately after unlock, but since it's on different monitors and doesn't behave like a standard window, I'm struggling to target it with a "Close" action that doesn't involve coordinates.

My Question:
What is the most reliable way in BTT to handle this? Specifically:

  1. Is there a way to ensure BTT targeting "remembers" or finds this window by its title ("SASE Secure Internet Access") across different displays?

  2. How can I close this window based on its title (or similar properties) without using mouse-based actions?

Any tips, AppleScript snippets, or specific BTT action sequences would be highly appreciated! :+1:

Thanks in advance!

can you check whether the "Activate Specific Window" action in BTT is able to activate that window?