I'm having trouble using the Update_Trigger function to update the look of a trigger.
This escape key changes it's own style based on a settings variable. Users can choose between an 'edge' look which makes the touchbar seem bezelless at the left side or stay with the original inset button.
I've tried the tip that @Andreas_Hegenberg gave me over at my previous post, but I can't seem to get it to work.
Issue: the widget is not appearing. It's logic seems to be correct so I suspect that the update_trigger implementation isn't right.
here's the JSON for you to paste in:
Open
{
"BTTWidgetName" : "esc (listens to settings)",
"BTTTriggerType" : 639,
"BTTTriggerTypeDescription" : "Apple Script Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 189,
"BTTPredefinedActionName" : "ESC (Escape Key, respects pressed modifiers)",
"BTTEnabled2" : 1,
"BTTUUID" : "033E04C4-A3EC-4394-AF1E-D9AE145118B2",
"BTTEnabled" : 1,
"BTTOrder" : 0,
"BTTDisplayOrder" : -1,
"BTTTriggerConfig" : {
"BTTScriptType" : 0,
"BTTTouchBarApplyCornerRadiusTo" : 2,
"BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 255.000000",
"BTTTouchBarButtonTextAlignment" : 1,
"BTTTouchBarItemPlacement" : 1,
"BTTTouchBarItemIconWidth" : 30,
"BTTTouchBarButtonCornerRadius" : 6,
"BTTTouchBarScriptUpdateInterval" : 5,
"BTTTouchBarAlternateBackgroundColor" : "0.000000, 0.000000, 0.000000, 0.000000",
"BTTTouchBarAppleScriptString" : "try\r\ttell application \"BetterTouchTool\"\r\t\ttry\r\t\t\tset RetrievedVar to get_string_variable \"ESC_Format\"\r\t\tend try\r\tend tell\r\t\r\tif RetrievedVar is \"Edge\" then\r\t\t--return \"esc \"\r\t\tupdate_trigger \"033E04C4-A3EC-4394-AF1E-D9AE145118B2\" json \"{\\\"BTTTriggerConfig\\\" : {\\\"BTTTouchBarButtonTextAlignment\\\" : 1,\\\"BTTTouchBarAlternateBackgroundColor\\\" : \\\"0.000000, 0.000000, 0.000000, 0.000000\\\",\\\"BTTTouchBarButtonCornerRadius\\\" : 6,\\\"BTTTouchBarApplyCornerRadiusTo\\\" : 2,\\\"BTTTouchBarButtonName\\\" : \\\"esc \\\",\\\"BTTTouchBarItemPlacement\\\" : 1,\\\"BTTTouchBarButtonColor\\\" : \\\"0.000000, 0.000000, 0.000000, 255.000000\\\",\\\"BTTTouchBarFreeSpaceAfterButton\\\" : 16,\\\"BTTTouchBarItemIconWidth\\\" : 30,\\\"BTTTouchBarItemPadding\\\" : -26,\\\"BTTTouchBarItemIconHeight\\\" : 30}}\"\r\t\treturn\r\t\t\r\telse\r\t\tupdate_trigger \"033E04C4-A3EC-4394-AF1E-D9AE145118B2\" json \"{\\\"BTTTriggerConfig\\\" : {\\\"BTTTouchBarAlternateBackgroundColor\\\" : \\\"0.000000, 0.000000, 0.000000, 0.000000\\\",\\\"BTTTouchBarItemIconHeight\\\" : 10,\\\"BTTTouchBarButtonCornerRadius\\\" : 6,\\\"BTTTouchBarItemPlacement\\\" : 1,\\\"BTTTouchBarButtonName\\\" : \\\"esc\\\",\\\"BTTTouchBarButtonColor\\\" : \\\"59.000000, 59.000000, 59.000000, 255.000000\\\",\\\"BTTTouchBarItemIconWidth\\\" : 10,\\\"BTTTouchBarFreeSpaceAfterButton\\\" : 20,\\\"BTTTouchBarItemPadding\\\" : 20,\\\"BTTHUDText\\\" : \\\"ESC\\\"}}\"\r\t\treturn\r\tend if\r\t\ron error\r\treturn \"esc\"\rend try",
"BTTTouchBarAppleScriptStringRunOnInit" : true,
"BTTTouchBarButtonName" : "esc (listens to settings)",
"BTTTouchBarAppleScriptUsePath" : 0,
"BTTTouchBarFreeSpaceAfterButton" : 16,
"BTTTouchBarItemIconHeight" : 30,
"BTTTouchBarItemPadding" : -26
}
}
You could probably hardcode the variable at the top to test the rules.
Thanks for the help!