Touch Bar widget not enabling. Please help

When I enable the touchbar widget it appears then disappears.

I have tried completely reinstalling Bettertouchtool and restarting it. I have also recreated the widget but nothing has worked.

Please help

Can you share screenshots of the widget?

1 Like

its an exact copy of this https://medium.com/@ahmic/touch-bar-instagram-followers-count-update-2020-ec6761a31475

but it also happens for other widgets.

You can add a try/ end try statement to your AppleScript and return " " for an else statement for the widget to always be present.

thank you for the help. I have figured out that it doesn't disappear with their username inputted. When I input my username it disappears.

Other than changing ahmic.jpg to my Instagram username is there anything else I need to change in the script?

-- change this to yours Instagram username
set userName to "ahmic.jpg"

set jsonData to do shell script "curl -s 'https://www.instagram.com/" & userName & "/?__a=1'"
set AppleScript's text item delimiters to {","}
set keyValueList to (every text item in jsonData) as list
set AppleScript's text item delimiters to ""

set followersItem to item 11 of keyValueList
set followersObject to RemoveFromString(""", followersItem)
set followersObject to RemoveFromString("{", followersObject)
set followersObject to RemoveFromString("}", followersObject)
set AppleScript's text item delimiters to {":"}
set theKeyValueFollowers to (every text item in followersObject) as list
set num to item 3 of theKeyValueFollowers

return ":male_detective: " & num

-- remove character or string from given string
on RemoveFromString(CharOrString, txt)
set AppleScript's text item delimiters to CharOrString
set temp to txt's text items
set AppleScript's text item delimiters to ""
return temp as text
end RemoveFromString

Its not my script btw. I don't know much about coding and scripts.

I tried it myself and have the same results. Maybe reaching out to the author would be more helpful as he wrote the script and will know it best. I am not exactly an expert either, just a nerd

ok thank you

try making sure the 'Show in Any Open Touch Bar Group' is ticked. Also make sure that you have a name for your button, and an icon.