Note: Before bug reporting, please make sure you have tried the latest (alpha) version of BetterTouchTool and that you have already tried to restart your system :-). If you encounter a crash, please attach a crash log from the macOS Console.app from the "User Diagnostic Reports" section.
Describe the bug
There are many issues with the scripting TextView. I believe it is not editing in UTF-8 mode.
As quite and double quotes are being replace with look alike but not right encoding counterparts.
However this bug ticket for this interesting case. This code runs fine in Visual Code or command prompt. end goal is along side cryptos current value I am putting the % of 24 hours
#!/opt/homebrew/bin/python3
import os
import json
from pycoingecko import CoinGeckoAPI
coin = os.getenv('COIN')
#coin = 'ethereum'
fiat = os.getenv('FIAT')
#fiat = 'usd'
cg = CoinGeckoAPI()
jsonData = cg.get_price(ids=coin, vs_currencies=fiat)
jsonDump = json.dumps(jsonData)
obj = json.loads(jsonDump)
output = obj[coin][fiat]
op = "{:.2f}".format(output)
#1
print('${0} ( -2.99%)'.format(op))
# above line should print the result but it makes the touch button disappear.
#2
print('${0}'.format(op))
# this line print the value just fine.
Affected input device Touch Bar
Screenshots
Not sure how to take screenshot of touch bar.
Device information:
- Type of Mac: Apple Silicon M1
- macOS version: 12.2.1
- BetterTouchTool version: 3.756
Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):
There is no workaround that I have found if anyone have any please do let me know.