Is there a way to toggle an app based on something visible on the screen?

Hello, I'm fairly new to the advanced features of BTT. I've been using it for years but only to do very basic things. Now I need a very specific feature and I'm wondering if anyone can help me figure out if this is possible.

I have two apps that don't play well together in a very specific scenario. The apps are PopClip and PasteBot.

PasteBot has a feature called Sequential Paste which brings up a small window when in use. This feature gets really buggy when PopClip is ON. So I just need to know if BTT would be able to toggle PopClip OFF when PasteBot's Sequential Paste window is visible and then toggle PopClip back ON when it is not visible.

Any ideas?


CleanShot 2024-11-02 at 16.11.10@2x

the problem is that constantly monitoring your screen would be overkill and cost a lot of battery/performance for just such a little thing.

Is there no other way to know when Sequential Paste gets activated? Are you maybe using a keyboard shortcut to activate that?

Hey, thanks for your help. Yes, I do have a shortcut set to activate the Sequential Paste window. Would there be a way to toggle PopClip with that same shortcut? I assumed you can't use the same shortcut for two different actions.

I don't understand much about it, but if you only want app A or app B to run, never both at the same time, then maybe a cycle action to do that with one shortcut would help?

Start app A and quit app B with this script

tell application "B" to if it is running then quit

The second cycle action would then be the opposite

Maybe :slightly_smiling_face:

Popclip allows to enable/disable via Apple Script.

So you can set it up like this:

  • override the shortcut you are using to show the sequential paste in BTT. Make sure to activate "prevent recursive triggers"
  • add a "Run Apple Script" action with this content:
tell application "PopClip" to set enabled to false
  • add another action that just sends the same shortcut again so this time pastebot can receive it:

In this example I'm using ctrl+opt+cmd+R, you'd need to adjust that to whatever you are using:

Now the only question is how you'd reenable Popclip afterwards. Maybe reenabling it after a fixed amount of time would be an option?

That is so damn cool. Had no idea BTT could do this! That worked perfectly! I think reenabling PopClip after a certain amount of time would be a great solution. I took a stab at trying to figure it out and this is what I came up with. Does it look right?


Also, is there a way to get the same results when I use my Logitech MX Master 3 to open the Sequential Paste window? Currently I have it set up to open the Sequential Paster window when I click/press the scroll wheel.