okay, im getting closer... I found out how to make a group with triggers inside of them...
[
{
"BTTTouchBarButtonName" : "TestGroup",
"BTTTriggerType" : 630,
"BTTTriggerTypeDescription" : "Group",
"BTTTriggerClass" : "BTTTriggerTypeNotchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTEnabled2" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "93FE9758-BDF8-40B4-A9AF-237D95624DFF",
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTOrder" : 42,
"BTTDisplayOrder" : 0,
"BTTMergeIntoTouchBarGroups" : 0,
"↓↓↓↓↓↓↓↓↓↓ HERE ↓↓↓↓↓↓↓↓↓↓ "
"BTTAdditionalActions" : [
{
"BTTTouchBarButtonName" : "Close Group",
"BTTTriggerType" : 696,
"BTTTriggerTypeDescription" : "Notch Bar Button",
"BTTTriggerClass" : "BTTTriggerTypeNotchBar",
"BTTPredefinedActionType" : 309,
"BTTPredefinedActionName" : "Close currently open Notch Bar group",
"BTTEnabled2" : 1,
"BTTAlternateModifierKeys" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "72C94654-B8A0-4A74-883F-DA7EFB1A9E07",
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTOrder" : 0,
"BTTDisplayOrder" : 0,
"BTTMergeIntoTouchBarGroups" : 0,
"BTTTriggerConfig" : {
"BTTNotchBarVisibilityNotchScreen" : 0,
"BTTTouchBarButtonCornerRadius" : 5,
"BTTTouchBarFreeSpaceAfterButton" : 5,
"BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 0.000000",
"BTTTouchBarApplyCornerRadiusTo" : 0,
"BTTTouchBarItemPlacement" : 1,
"BTTTouchBarIconInvert" : true,
"BTTTouchBarAlwaysShowButton" : false,
"BTTTouchBarButtonHoverColor" : "248.880000, 146.115000, 128.010000, 181.050000",
"BTTNotchBarVisibilityStandardScreen" : 0,
"BTTTouchBarButtonWidth" : 100,
"BTTTouchBarItemIconHeight" : 15,
"BTTTouchBarItemSFSymbolDefaultIcon" : "xmark.circle.fill",
"BTTTouchBarButtonTextAlignment" : 0,
"BTTTouchBarAlternateBackgroundColor" : "75.323769, 75.323769, 75.323769, 255.000000",
"BTTTouchBarItemIconType" : 2,
"BTTTBWidgetWidth" : 400,
"BTTTouchBarBorderColor" : "0.000000, 0.000000, 0.000000, 0.000000",
"BTTTouchBarItemIconWidth" : 15,
"BTTTouchBarFreeSpaceBeforeButton" : 0,
"BTTTouchBarButtonFontSize" : 12,
"BTTTouchBarIconTextOffset" : 5,
"BTTTouchBarOnlyShowIcon" : true,
"BTTNotchBarItemVisibleOnStandardScreen" : true,
"BTTTouchBarItemPadding" : 0
}
},
{
"BTTTouchBarButtonName" : "TestButton",
"BTTTriggerType" : 696,
"BTTTriggerTypeDescription" : "Notch Bar Button",
"BTTTriggerClass" : "BTTTriggerTypeNotchBar",
"BTTPredefinedActionType" : 371,
"BTTPredefinedActionName" : "Show Notification",
"BTTEnabled2" : 1,
"BTTRepeatDelay" : 0,
"BTTUUID" : "89110803-AB0C-43C6-A444-2B1BC1D0D468",
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTOrder" : 1,
"BTTDisplayOrder" : 0,
"BTTMergeIntoTouchBarGroups" : 0,
"BTTAdditionalActions" : [
{
"BTTTriggerType" : -1,
"BTTTriggerClass" : "BTTTriggerTypeNotchBar",
"BTTPredefinedActionType" : 248,
"BTTPredefinedActionName" : "Trigger Named Trigger (Configured in Other Tab)",
"BTTGenericActionConfig" : "test json",
"BTTNamedTriggerToTrigger" : "test json",
"BTTEnabled2" : 1,
"BTTAlternateModifierKeys" : 0,
"BTTRepeatDelay" : 0,
"BTTUUID" : "63E6DCE0-B254-4182-BF9F-B9B364D6CB0E",
"BTTNotesInsteadOfDescription" : 0,
"BTTEnabled" : 1,
"BTTModifierMode" : 0,
"BTTOrder" : 283,
"BTTDisplayOrder" : 0,
"BTTMergeIntoTouchBarGroups" : 0
}
],
"BTTTriggerConfig" : {
"BTTTouchBarOnlyShowIcon" : false,
"BTTTouchBarItemPadding" : 0,
"BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 0.000000",
"BTTTouchBarApplyCornerRadiusTo" : 0,
"BTTTouchBarItemPlacement" : 0,
"BTTTouchBarIconInvert" : false,
"BTTTouchBarAlwaysShowButton" : false,
"BTTTouchBarButtonHoverColor" : "248.880000, 146.115000, 128.010000, 181.050000",
"BTTNotchBarVisibilityStandardScreen" : -1,
"BTTTouchBarButtonHeight" : 15,
"BTTTouchBarButtonWidth" : 100,
"BTTTouchBarItemIconHeight" : 15,
"BTTTouchBarButtonTextAlignment" : 0,
"BTTTouchBarAlternateBackgroundColor" : "75.323769, 75.323769, 75.323769, 255.000000",
"BTTTBWidgetWidth" : 400,
"BTTTouchBarBorderColor" : "0.000000, 0.000000, 0.000000, 51.000000",
"BTTTouchBarFreeSpaceBeforeButton" : 0,
"BTTTouchBarItemIconWidth" : 15,
"BTTTouchBarButtonName" : "TestButton",
"BTTTouchBarButtonFontSize" : 12,
"BTTTouchBarIconTextOffset" : 5,
"BTTNotchBarVisibilityNotchScreen" : 0,
"BTTTouchBarButtonCornerRadius" : 5,
"BTTTouchBarFreeSpaceAfterButton" : 0
}
}
],
"↑↑↑↑↑↑↑↑↑↑ TO HERE ↑↑↑↑↑↑↑↑↑↑↑ "
"BTTTriggerConfig" : {
"BTTNotchBarVisibilityNotchScreen" : 0,
"BTTTouchBarItemPadding" : 0,
"BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 0.000000",
"BTTTouchBarApplyCornerRadiusTo" : 0,
"BTTTouchBarItemPlacement" : 0,
"BTTTouchBarIconInvert" : false,
"BTTTouchBarAlwaysShowButton" : false,
"BTTNotchBarActivateWidgetModeForGroup" : false,
"BTTTouchBarButtonHoverColor" : "248.880000, 146.115000, 128.010000, 181.050000",
"BTTNotchBarVisibilityStandardScreen" : 1,
"BTTTouchBarButtonHeight" : 15,
"BTTTouchBarButtonWidth" : 100,
"BTTKeepGroupOpenWhileSwitchingApps" : false,
"BTTNotchBarUnhideForGroup" : false,
"BTTTouchBarItemIconHeight" : 15,
"BTTTouchBarButtonTextAlignment" : 0,
"BTTTouchBarAlternateBackgroundColor" : "75.323769, 75.323769, 75.323769, 255.000000",
"BTTTBWidgetWidth" : 400,
"BTTTouchBarBorderColor" : "0.000000, 0.000000, 0.000000, 51.000000",
"BTTTouchBarFreeSpaceBeforeButton" : 0,
"BTTTouchBarItemIconWidth" : 15,
"BTTTouchBarButtonName" : "TestGroup",
"BTTTouchBarButtonFontSize" : 12,
"BTTTouchBarIconTextOffset" : 5,
"BTTTouchBarOnlyShowIcon" : false,
"BTTTouchBarButtonCornerRadius" : 5,
"BTTTouchBarFreeSpaceAfterButton" : 0
}
}
]
This is already A LOT to take in (not a coder or designer by any means...). Will this work with the update_trigger and update the BTTAdditionalActions portion? and use the UUID of this group? I don't want to overwrite all of the buttons/triggers inside of this group, just add them... I was thinking I could store JUST that piece (BTTAdditionalActions) of the json for the group, then append it with the new triggers, but I don't see how that can be done (pulling a piece of a triggers json).
tell application "BetterTouchTool"
update_trigger "89110803-AB0C-43C6-A444-2B1BC1D0D468" json "{\"BTTAdditionalActions\" : \"<<action here which is a function I use to create buttons>>>\"}"
end tell
This is the easiest and most reusable method, but I was also thinking I could do one of these:
- just keep deleting and re-adding the group, but im thinking this will be cumbersome...
- make each group have about 50 disabled buttons as placeholders. then my script would update each of those...
idk lmk what you think. Thanks!