<BTT Clipboard Manager> CAG causes Spotify to relaunch immediately after quitting

Hi Andreas and the Community,

I’ve tracked down a strange issue where Spotify immediately relaunches after I quit it while BetterTouchTool is running.

I eventually isolated the behaviour to the automatically generated <BTT Clipboard Manager> Conditional Activation Group.

Reproduction:

  1. Start BTT with <BTT Clipboard Manager> enabled
  2. Open Spotify
  3. Quit Spotify with ⌘Q
  4. Spotify immediately relaunches

If I disable <BTT Clipboard Manager>, quit/relaunch BTT, and repeat the test, Spotify stays closed. The Clipboard Manager itself continues to work normally.

Deleting <BTT Clipboard Manager> does not solve it because BTT recreates the group on launch and the issue returns.

I also ruled out:

  • my Spotify-specific BTT triggers/Touch Bar buttons
  • the Touch Bar subsystem entirely
  • BetterTouchToolNowPlaying2 killing that helper does not stop the relaunch
  • user AppleScripts containing Spotify/Now Playing references

BTT's log repeatedly shows this around the event:

SWIFT|is playing script {"OSAScriptErrorNumberKey":-609,"NSLocalizedDescription":"Spotify got an error: Connection is invalid."}

A LaunchServices trace also showed that Spotify exits normally and is then relaunched about 50 ms later, hidden, with BetterTouchTool itself as the parent/requesting process.

So it looks as though enabling the automatically generated Clipboard Manager conditional group somehow activates BTT's internal Spotify/"is playing" polling code.

Workaround: leaving <BTT Clipboard Manager> disabled completely fixes the issue, while Clipboard Manager itself still works.

Happy to provide the relevant BTT/LaunchServices logs if useful.

BTT version: 6.748
macOS version: Macbook Pro 2020 (Intel), Tahoe 26.6.2 (25G83)
Spotify version: 1.2.97.270

I would guess you have accidentally added some now playing related trigger to that CAG. You can delete the CAG, or you could select the CAG and select the „all trigger categories“ section to see whether it contains something it should not

Thanks:) I checked exactly that, with <BTT Clipboard Manager> selected and All Trigger Categories selected, there are actually no triggers listed at all in the CAG.

I had also previously tried deleting the CAG entirely. BTT automatically recreates <BTT Clipboard Manager> after relauncha and the Spotify behaviour returns with the newly recreated empty CAG.

The behaviour is very reproducible:

  • <BTT Clipboard Manager> enabled > after Spotify has been opened once, quitting it causes it to immediately relaunch
  • <BTT Clipboard Manager> disabled > Spotify quits normally
  • Clipboard Manager itself continues to work with the CAG disabled

BTT’s log around the relaunch also repeatedly shows:

SWIFT|is playing script {"OSAScriptErrorNumberKey":-609,"NSLocalizedDescription":"Spotify got an error: Connection is invalid."}

So it doesn’t seem to be an accidentally added trigger, unless there is something associated with the CAG that isn’t shown under All Trigger Categories.

I added some more checks that should prevent any spotify launching regardless of why and how the now playing data is accessed in 6.754!

Thanks a lot for your prompt reply. And, of course, for the immensely great app :folded_hands: