Widget disappears if "Show icon only, no text" is enabled and the icon is changed through update_touchbar_widget

If you change a widget's icon to a local file through applescript (with widget text disabled), the widget disappears and either never comes back, or spawns back in a second later, incrementally like a webpage loading. It will never come back if you put exactly the same code in the actual widget (where it auto updates every X seconds).

However if you enable text, the button performs exactly as expected (with no lag).

This seems related to the "always run when widget becomes visible" checkbox in the overall widget "widget specific" tab under "Widget Specific Config:". Disable it, and it fixes it (somewhat??)

Recreation steps

  1. Create an applescript widget
  2. Give it a "run applescript async" trigger
  3. Give it a name too, doesn't matter
  4. Check "Show icon only, no text"
  5. Give it a default icon
  6. In the trigger code, put:

tell application "BetterTouchTool"

update_touch_bar_widget "4F00D1EA-3277-4BE6-8BA1-02433145E086" icon_path "/Users/user/Documents/Touchbar/play.png"

update_touch_bar_widget "4F00D1EA-3277-4BE6-8BA1-02433145E086" icon_path "/Users/user/Documents/Touchbar/pause.png"

end tell

But obviously use your own existing files and UUIDs.

  1. Press the button.

Device information:

  • Type of Mac: MacBook Pro (15-inch, 2017)
  • macOS version: 10.13.4 (17E199)
  • BetterTouchTool version: 2.835

Seems pretty similar to this: