BTT cannot detect the media currently playing

Andreas, is it possible that the BetterTouchToolNowPlaying.app is stealing the keyboard/focus? I cannot reproduce it if I change the track manually. Occasionally I'm in the terminal or somewhere else where I type text and all of the sudden my keyboard presses does nothing - this happens when new track is starting and I always see the BetterTouchToolNowPlaying.app in the menu bar.

It does not happen every time.

mhh I think I have set it to launch in background, but I‘ll check! Or could it be some floating menu?

I have only 1 floating menu, which steals the keyboard focus, but it is being triggered by a shortcut + it is a big one which definitely it is not showing.

@xidiot, I tried to reproduce the issue but am unable to so far. I tried with standard media apps like spotify and music, but also safari. I couldn't get it to loose keyboard focus. I would guess it's caused by something else.

Do you have a reliable way to reproduce it on your side?

I haven't find a way - each time I like to reproduce it nothing happens :\ . It only happens when I'm casually working :smiley:

Here's a screen recording where you can see that the text input is slightly delayed/blocked when I change the song. This is the closest to reproducing, but not if this will help you, since I'm not even sure it is the same:

@xidiot I have added some more code to prevent activation of the helper app in 5.387, maybe this helps :man_shrugging:

I'll monitor it thru out the day, but I've noticed that BTTCurrentlyPlaying and BTTCurrentlyPlayingApp are not showing correct values and BTTNowPlayingInfoSequoia does:

Weird, it seems to update ok here. Possibly that's a timing issue because it's now slightly faster. Could you check whether 5.390 resolves this?

With that version there is however a change, the BTTCurrentlyPlayingApp will stay set even if BTTCurrentlyPlaying is 0. (I think that makes sense, because it's still the currently playing app but possibly paused)

You should see a "BetterTouchToolNowPlaying2" app running in activity monitor

BTTCurrentlyPlayingApp is staying which is great and it makes sense, however on changing tracks, either manually or automatically (if they are in a playlist), the BTTCurrentlyPlaying is still showing 0.

is this with a specific app?

Yep, it seems that it is Safari related. I've tested with Firefox - no issues.

I also have some issues with this (which were not present a few days ago, tried the stable and alpha version, behavior is identical).

The script i use to fetch the Now Playing info seems to work fine as before (as confirmed when running it from the BTT config for my floating menu), but the script's result is not shown in the floating menu.

Script for reference:

(async () => {

    let trigger = await get_number_variable({ variable_name: 'BTTCurrentlyPlaying' })
    let artist = await get_string_variable({ variable_name: 'BTTNowPlayingInfoArtist' })
   	let song = await get_string_variable({ variable_name: 'BTTNowPlayingInfoTitle' })
   	let result = '-'

   	if (artist.length > 0) {
       	result = artist + ' ' + result;
   	} else {
       	result = ''
   	}

   	if (song.length > 0) {
       	result = result + ' ' + song;
   	}

   returnToBTT(result)

})();

I also have this static text that should always be visible in the floating menu (when hovered), but it's no longer there. That text is being returned by a script (which was also working fine recently), here's the script:

(async () => {
	returnToBTT('My static text');
})();

Thank you !

@xidiot could you try whether your safari playing info refreshes correctly when you post this notification: BTTNowPlayingInfoRequested

If so I'll add some polling when safari is active, looks like it's using some non-standard ways.

@SimpleUser could you share that floating menu? Then I can better check what's happening. With recent alphas you can also use variables directly in the floating menu item text by wrapping them in curly braces

Sent you the floating menu in a private message.

Thank you

1 Like

Right after I triggered it - the BTTCurrentlyPlaying was immediately changed to the correct value.

1 Like

Andreas, just FYI - the BTTCurrentlyPlaying is now working as expected (when using Safari) + I think the issue with stealing focus is also resolved.

BTT version: 5.392 (2025051404)

Thank you!