bttWidgetSliderMoved not triggering

I have added the Volume Slider Widget trigger to my touch bar. I have set 10% for Trigger after sliding. Then I added a Run AppleScript async action to it, that looks like this:

on bttWidgetSliderMoved(newSliderValue)
    display dialog "OK"
end bttWidgetSliderMoved

However, this never seems to run, no matter how much I slide my volume widget.

Any ideas?

displaying dialogs only works with the non-async/non-background versions of the apple script runner.

I think there might also be an issue which requires you to return a string to make it work (I'm looking into this right now)

on bttWidgetSliderMoved(newSliderValue)
    display dialog "OK"
    return "done"
end bttWidgetSliderMoved

Not working with blocking applescript on v4.257.

ah it has been a few years since I looked into this.

Unfortunately you are right, Apple Scripts displaying UI won't work with these at all, regardless of whether it's run in background or foreground. Worse: they will lock up the Apple Script runner process, so after running such a script you need to restart BTT.

If you need to display UI from within such a slider, try this to show a BTT HUD:

on bttWidgetSliderMoved(sliderValue)
    tell application "BetterTouchTool"
    
    trigger_action "{\"BTTPredefinedActionType\": 254, \"BTTHUDActionConfiguration\": \"{\\\"BTTActionHUDDetail\\\":\\\"hud detail text\\\",\\\"BTTActionHUDTitle\\\":\\\"hud title\\\",\\\"BTTActionHUDDuration\\\":\\\"0.7\\\",\\\"BTTActionHUDBackground\\\":\\\"38.719535, 38.720697, 38.720067, 213.662109\\\",\\\"BTTActionHUDSlideDirection\\\":0}\"}"
    
    end tell

end bttWidgetSliderMoved

Thanks for looking into this. I need this event in order to set different icon depending on system volume percentage. I need to mimic default volume button behavior.