Sorry - This is the button I'm trying to make work, that code should paste into BTT
[
{
"BTTLastUpdatedAt" : 1790474655.1143961,
"BTTTriggerType" : 773,
"BTTTriggerTypeDescription" : "Standard Item",
"BTTTriggerParentUUID" : "0A3A55AA-2518-4825-8E28-830647E6A699",
"BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
"BTTUUID" : "D8FB8EF8-9C4F-4FFE-AE7E-B372CF69A333",
"BTTAdditionalConfiguration" : "Menu Item: Mic",
"BTTOrder" : 0,
"BTTTriggerName" : "Menu Item: Mic",
"BTTMenuItemActions" : [
{
"BTTLastUpdatedAt" : 1790395681.697916,
"BTTTriggerParentUUID" : "D8FB8EF8-9C4F-4FFE-AE7E-B372CF69A333",
"BTTIsPureAction" : true,
"BTTUUID" : "1A71D2D3-CEF2-472E-9ED4-36776E6BF690",
"BTTPredefinedActionType" : 281,
"BTTPredefinedActionName" : "Run Real JavaScript",
"BTTAdditionalActionData" : {
"BTTScriptFunctionToCall" : "toggleMute",
"BTTJavaScriptUseIsolatedContext" : false,
"BTTAppleScriptRunInBackground" : false,
"BTTScriptType" : 3,
"BTTActionJSRunInSeparateContext" : false,
"BTTScriptString" : "async function toggleMute() {\n try {\n const response = await fetch('http://localhost:3491/v1/mute', { method: 'POST' });\n if (!response.ok) throw new Error(`HTTP ${response.status}`);\n const result = await response.json();\n console.log('Mute toggled:', result);\n return result;\n } catch (error) {\n console.error('Error toggling mute:', error);\n throw error; // or return null, so the caller can tell it failed\n }\n}",
"BTTAppleScriptUsePath" : false,
"BTTScriptLocation" : 0
},
"BTTGenericActionConfig" : "async function toggleMute() {\n try {\n const response = await fetch('http://localhost:3491/v1/mute', { method: 'POST' });\n if (!response.ok) throw new Error(`HTTP ${response.status}`);\n const result = await response.json();\n console.log('Mute toggled:', result);\n return result;\n } catch (error) {\n console.error('Error toggling mute:', error);\n throw error; // or return null, so the caller can tell it failed\n }\n}",
"BTTOrder" : 0
}
],
"BTTMenuConfig" : {
"BTTMenuAlternateModeActiveVariable" : "",
"BTTMenuAlwaysUseLightMode" : 1,
"BTTMenuAttributedText" : "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2907\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n}",
"BTTMenuAttributedTextAlt" : "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2907\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n}",
"BTTMenuElementIdentifier" : "Mic",
"BTTMenuItemBackgroundColor" : "52.0, 199.0, 89.0, 255.0",
"BTTMenuItemBackgroundColorDark" : "52.0, 199.0, 89.0, 255.0",
"BTTMenuItemBackgroundColorHover" : "52.0, 199.0, 89.0, 255.0",
"BTTMenuItemBackgroundColorHoverDark" : "52.0, 199.0, 89.0, 255.0",
"BTTMenuItemBackgroundType" : 4,
"BTTMenuItemBackgroundTypeDark" : 4,
"BTTMenuItemBlurredBackground" : 0,
"BTTMenuItemBorderWidth" : 0,
"BTTMenuItemCornerRadius" : 0,
"BTTMenuItemIconColor1" : "255.0, 255.0, 255.0, 255.0",
"BTTMenuItemIconPosition" : 4,
"BTTMenuItemIconType" : 2,
"BTTMenuItemIconTypeAlt" : 2,
"BTTMenuItemMaxHeight" : 96,
"BTTMenuItemMaxWidth" : 96,
"BTTMenuItemMinHeight" : 96,
"BTTMenuItemMinWidth" : 96,
"BTTMenuItemPaddingBottom" : 0,
"BTTMenuItemPaddingLeft" : 0,
"BTTMenuItemPaddingRight" : 0,
"BTTMenuItemPaddingTop" : 0,
"BTTMenuItemResizeImage" : 3,
"BTTMenuItemScriptActive" : true,
"BTTMenuItemSFSymbolName" : "mic.fill",
"BTTMenuItemSFSymbolStyle" : 1,
"BTTMenuItemSFSymbolWeight" : 0,
"BTTMenuItemVisibleWhileActive" : 1,
"BTTMenuItemVisibleWhileInactive" : 1,
"BTTMenuScriptAlwaysRunOnAppear" : 1,
"BTTMenuScriptAlwaysRunOnFirstLoad" : 1,
"BTTMenuScriptRunOnMenuHover" : false,
"BTTMenuScriptSettings" : {
"BTTAppleScriptRunInBackground" : false,
"BTTAppleScriptString" : "async function getStatus() {\n try {\n const response = await fetch('http://localhost:3491/v1/status', { method: 'GET' });\n const result = await response.json();\n console.log('Got Status:', result);\n return result;\n } catch (error) {\n console.error('Error Getting Status:', error);\n throw error; // or return null, so the caller can tell it failed\n }\n}",
"BTTAppleScriptUsePath" : false,
"BTTJavaScriptUseIsolatedContext" : false,
"BTTScriptFunctionToCall" : "getStatus",
"BTTScriptLocation" : 0,
"BTTScriptType" : 3
},
"BTTMenuScriptUpdateInterval" : 1,
"BTTMenuTextMinimumScaleFactor" : 0.3,
"BTTMenuUseStyleForSubmenu" : 1
},
"BTTMenuAvailability" : 0,
"BTTMenuName" : "Mic",
"BTTGestureNotes" : "Standard Item"
}
]