Refresh a Streamdeck button

Hallo,

questions about the Streamdeck button. (I use BTT plugin Stream Deck option)

Is there a way to refresh a Streamdeck button (with Java script or so) so that a different Icon/color/Text is displayed, depending on a custom variable ?

When I have conditions defined for two buttons (see screen) always the second is displayed, while the condition is not true (the variable play is 'off' ).

who would be able to help ?

thx,
Christian

Running:
BTT 3.9993 (2193) / Mac M1 Max OS 13.2 (22D49)
BTT plugin Stream Deck option
Stream Deck Mobile (on iPad Air) latest version

Have you tried this one?

Bildschirmfoto von BetterTouchTool (20-01-23, 18-18-49)

Bildschirmfoto von IINA (20-01-23, 18-22-37)

Hallo,

Yes, thanks. I have used/tested the "Toggle on/off button", and it works fine as such,
but not quite for my purposes..

Here is my use case:
I use StreamDeck & BTT with Ableton Live (DAW for music production).
'Playing/stopping' a track in Ableton can be done with:

  • the keyboard spacebar
  • with the mouse hitting the 'play icon' on sceen
  • via the various MIDI controllers
  • and also via one of my BTT Java scripts to trigger actions

I want to reflect that 'play/stop' state on the Streamdeck button
( with a green/red icon/text for example ).

When I would use only Streamdeck to 'play and stop', the "Toggle on/off button" works fine, but when I 'stop' the track via the Spacebar/Mouse/MIDI controller, the Streamdeck button is not updated/synced…(which is obvious).

In BTT I have a Java script which checks the color of the 'play' button on a given x/y position on screen.

So I 'know' in BTT what the play/stop state of Ableton is, which I would like to use to change/refresh ( somehow ) a SD button dynamically.

There is another issue with the BTT "Toggle on/off button" for my case:
I have a 'play' button on differnent pages in the Streamdeck and those are not in sync with each other.
For example: One shows play and when changing in SD to a different page that play button on that page still shows 'stop'.

anyway, thanks again.
Christian

Running:
BTT 3.9993 (2193) / Mac M1 Max OS 13.2 (22D49)
BTT plugin Stream Deck option
Stream Deck Mobile (on iPad Air) latest version

ha,
I guess I found the solution...(i.e next time I better read the documentation properly...)
the Apple Script Widget will do the trick...brilliant...

You can also always use the
update_stream_deck_widget script call, or to permanently update a trigger the update_triggerfunction.
If you just want to run the Apple Script of a script widget to refresh it, you can use the refresh_widget function.

See Using Apple Script or JXA · GitBook

Hallo Andreas,

thanks a lot. Everything works fine now.

…question about the "Excecute script every X seconds"
incombination with the "[X] Always run when widget becomes visible" to fully
understand the behavior.

Does "Excecute script every 2 seconds" runs the script always every 2 sec even when the widget/button is not visible on Streamdeck ?

Thx,
Christian

Running:
BTT 3.9993 (2193) / Mac M1 Max OS 13.2 (22D49)
BTT plugin Stream Deck option
Stream Deck Mobile (on iPad Air)

It will only run if the button is visible