CAG + Specific App Did Activate not working

Describe the bug

When I tab to Microsoft Teams, I expected the Overlay to show up given that the customVariable2 is indeed TRUE (the only condition on my activation group). I have added other named triggers (repeating action) to test that the CAG is active and it is definitely working.

When I have this "Specific App did activate" Named Trigger in the "All Apps" group, it works flawlessly. However, when I moved it to the CAG "Call Status" (which is active if customVariable2 != "on"), it has no effect.

I tested with other apps too (discord, Finder, etc) -- no effect. There seems to be an incompatibility between this trigger type inside of a CAG.

[
  {
    "BTTActivationGroupName" : "Call Status",
    "BTTAppName" : "Call Status",
    "BTTAppAutoInvertIcon" : 1,
    "BTTAppProcessMatchMode" : 3,
    "BTTActivationGroupCondition" : "YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGvEBYLDBMYICorLjU5Pj9CRkpPUFNbX2NlVSRudWxs0w0ODxAREl8QF05TQ29tcG91bmRQcmVkaWNhdGVUeXBlXxAPTlNTdWJwcmVkaWNhdGVzViRjbGFzcxACgAKAFdIUDxUXWk5TLm9iamVjdHOhFoADgBTUDxkaGxwdHh9fEBFOU1JpZ2h0RXhwcmVzc2lvbl8QEE5TTGVmdEV4cHJlc3Npb25fEBNOU1ByZWRpY2F0ZU9wZXJhdG9ygBOADoAEgBHVISIjJA8lJicoKVlOU09wZXJhbmReTlNTZWxlY3Rvck5hbWVfEBBOU0V4cHJlc3Npb25UeXBlW05TQXJndW1lbnRzgAaABRADgAiADVx2YWx1ZUZvcktleTrSIw8sLRABgAfSLzAxMlokY2xhc3NuYW1lWCRjbGFzc2VzXxAQTlNTZWxmRXhwcmVzc2lvbqMxMzRcTlNFeHByZXNzaW9uWE5TT2JqZWN00hQPNjihN4AJgAzTDyM6Ozw9WU5TS2V5UGF0aIALEAqACl8QD2N1c3RvbVZhcmlhYmxlMtIvMEBBXxAcTlNLZXlQYXRoU3BlY2lmaWVyRXhwcmVzc2lvbqNAMzTSLzBDRF5OU011dGFibGVBcnJheaNDRTRXTlNBcnJhedIvMEdIXxATTlNLZXlQYXRoRXhwcmVzc2lvbqRHSTM0XxAUTlNGdW5jdGlvbkV4cHJlc3Npb27TSyMPTE1OXxAPTlNDb25zdGFudFZhbHVlgA8QAIAQUm9u0i8wUVJfEBlOU0NvbnN0YW50VmFsdWVFeHByZXNzaW9uo1EzNNUPVFVWV1hNWU1aWk5TTW9kaWZpZXJYTlNOZWdhdGVZTlNPcHRpb25zXk5TT3BlcmF0b3JUeXBlgBIJEAXSLzBcXV8QG05TRXF1YWxpdHlQcmVkaWNhdGVPcGVyYXRvcqNcXjRfEBNOU1ByZWRpY2F0ZU9wZXJhdG9y0i8wYGFfEBVOU0NvbXBhcmlzb25QcmVkaWNhdGWjYGI0W05TUHJlZGljYXRl0i8wRWSiRTTSLzBmZ18QE05TQ29tcG91bmRQcmVkaWNhdGWjZmI0AAgAEQAaACQAKQAyADcASQBMAFEAUwBsAHIAeQCTAKUArACuALAAsgC3AMIAxADGAMgA0QDlAPgBDgEQARIBFAEWASEBKwE6AU0BWQFbAV0BXwFhAWMBcAF1AXcBeQF+AYkBkgGlAakBtgG_AcQBxgHIAcoB0QHbAd0B3wHhAfMB+AIXAhsCIAIvAjMCOwJAAlYCWwJyAnkCiwKNAo8CkQKUApkCtQK5AsQCzwLYAuIC8QLzAvQC9gL7AxkDHQMzAzgDUANUA2ADZQNoA20DgwAAAAAAAAIBAAAAAAAAAGgAAAAAAAAAAAAAAAAAAAOH",
    "BTTAppSpecificSettings" : {

    },
    "BTTTriggers" : [
      {
        "BTTGestureNotes" : "Fixes notification focus stealing",
        "BTTTriggerType" : 671,
        "BTTTriggerTypeDescription" : "Specific App Did Activate: Microsoft%20Teams.app",
        "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
        "BTTPredefinedActionType" : 254,
        "BTTPredefinedActionName" : "Show HUD Overlay",
        "BTTHUDActionConfiguration" : "{\"BTTActionHUDDetail\":\"\",\"BTTActionHUDTitle\":\"fixing teams\",\"BTTActionHUDDuration\":0.90000000000000002,\"BTTActionHUDBackground\":\"38.719535, 38.720697, 38.720067, 213.662109\",\"BTTActionHUDSlideDirection\":0}",
        "BTTAdditionalConfiguration" : "file:\/\/\/Applications\/Microsoft%20Teams.app",
        "BTTEnabled2" : 1,
        "BTTAlternateModifierKeys" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "5909E8A3-3D28-484A-99CC-3C8D5485F826",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTOrder" : 0,
        "BTTDisplayOrder" : 0,
        "BTTAdditionalActions" : [
          {
            "BTTGestureNotes" : "Fixes notification focus stealing",
            "BTTTriggerType" : 671,
            "BTTTriggerTypeDescription" : "Specific App Did Activate: Microsoft%20Teams.app",
            "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
            "BTTPredefinedActionType" : 124,
            "BTTPredefinedActionName" : "Trigger Menubar Menu-Item",
            "BTTMenubarPath" : "Window;*| Microsoft Teams",
            "BTTAdditionalConfiguration" : "file:\/\/\/Applications\/Microsoft%20Teams.app",
            "BTTEnabled2" : 1,
            "BTTAlternateModifierKeys" : 0,
            "BTTRepeatDelay" : 0,
            "BTTUUID" : "6E01111E-635F-4761-8AB9-69897F97BF97",
            "BTTNotesInsteadOfDescription" : 0,
            "BTTEnabled" : 1,
            "BTTModifierMode" : 0,
            "BTTOrder" : 0,
            "BTTDisplayOrder" : 0,
            "BTTAdditionalActions" : [
              {
                "BTTTriggerType" : -1,
                "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
                "BTTPredefinedActionType" : 122,
                "BTTPredefinedActionName" : "Show Notification Center",
                "BTTEnabled2" : 1,
                "BTTAlternateModifierKeys" : 0,
                "BTTRepeatDelay" : 0,
                "BTTUUID" : "29B090C7-C0E2-4527-89E9-83D8CC80AB94",
                "BTTNotesInsteadOfDescription" : 0,
                "BTTEnabled" : 1,
                "BTTModifierMode" : 0,
                "BTTOrder" : 0,
                "BTTDisplayOrder" : 0
              }
            ],
            "BTTTriggerConfig" : {
              "BTTHUDText" : "Focusing...",
              "BTTShowHUD" : 1
            }
          }
        ],
        "BTTTriggerConfig" : {
          "BTTHUDText" : "Focusing..."
        }
      },
      {
        "BTTTriggerType" : 678,
        "BTTTriggerTypeDescription" : "Repeating or Time Based Trigger",
        "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
        "BTTPredefinedActionType" : 254,
        "BTTPredefinedActionName" : "Show HUD Overlay",
        "BTTHUDActionConfiguration" : "{\"BTTActionHUDDetail\":\"\",\"BTTActionHUDTitle\":\"Call Inactive\",\"BTTActionHUDDuration\":0.89999997615814209,\"BTTActionHUDBackground\":\"38.719535, 38.720697, 38.720067, 213.662109\",\"BTTActionHUDSlideDirection\":0}",
        "BTTAdditionalConfiguration" : "{\"BTTTimedWhenToTrigger\":0,\"BTTTimedRepeatEveryXSeconds\":\"5\"}",
        "BTTEnabled2" : 0,
        "BTTAlternateModifierKeys" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "240881A6-16DD-4D39-AF2E-02D39ED11890",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTOrder" : 1,
        "BTTDisplayOrder" : 0,
        "BTTTriggerConfig" : {
          "BTTHUDText" : "no call"
        }
      },
      {
        "BTTTriggerType" : 0,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 122,
        "BTTPredefinedActionName" : "Show Notification Center",
        "BTTAdditionalConfiguration" : "1048576",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutScope" : 0,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "E01B79AC-FBB2-4AF3-A3F0-2FE3AA0B183C",
        "BTTTriggerOnDown" : 1,
        "BTTNotesInsteadOfDescription" : 0,
        "BTTLayoutIndependentChar" : "TAB",
        "BTTEnabled" : 0,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : 48,
        "BTTShortcutModifierKeys" : 1048576,
        "BTTOrder" : 0,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0,
        "BTTTriggerConfig" : {
          "BTTHUDText" : "alttab",
          "BTTShowHUD" : 1
        }
      },
      {
        "BTTTriggerType" : 671,
        "BTTTriggerTypeDescription" : "Specific App Did Activate: Discord.app",
        "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
        "BTTPredefinedActionType" : 254,
        "BTTPredefinedActionName" : "Show HUD Overlay",
        "BTTHUDActionConfiguration" : "{\"BTTActionHUDDetail\":\"\",\"BTTActionHUDTitle\":\"discord\",\"BTTActionHUDDuration\":0.90000000000000002,\"BTTActionHUDBackground\":\"38.719535, 38.720697, 38.720067, 213.662109\",\"BTTActionHUDSlideDirection\":0}",
        "BTTAdditionalConfiguration" : "file:\/\/\/Users\/amaisano\/Applications\/Discord.app",
        "BTTEnabled2" : 1,
        "BTTAlternateModifierKeys" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "E4348AD4-9E7D-40EA-B38D-4F6C40901E95",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTOrder" : 2,
        "BTTDisplayOrder" : 0
      }
    ]
  }
]

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
N/A

Screenshots


Device information:

  • Type of Mac: Macbook Pro 2019 (touchbar)
  • macOS version: Catalina (10.15.7)
  • BetterTouchTool version: 3.505

Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):

Hi @Andreas_Hegenberg - are you or others able to confirm/recreate this issue? It's really affecting my daily workflow. Would be great to get some feedback, or a workaround. Thanks!

Unfortunately that trigger type currently only works on the top level but it's on my TODO list to make it app / cag specific.

What are you trying to achieve? Maybe there is another way.

During normal system conditions (meeting == off), whenever i application switch to Teams, i run a select menu item action to change window focus (teams notification window constantly steals focus).

If a system condition like "in a meeting" is "on" (determined by setting a custom variable to true), then when i switch to Teams from another app, I want to SKIP this behavior (ideally, do different behavior).

@Andreas_Hegenberg sorry to ping again, but really hoping for some advice on how to get around this for now, or if there's an upcoming change to the codebase I can expect to help with this.

Thanks :slight_smile:

@Andreas_Hegenberg one last bump here from me, I promise.

Unless you have any other ideas or a bugfix/feature add for this support, I think I may have a workaround (untested).

It looks like I can toggle presets on and off as an action. So if I isolate my "meeting mode" named trigger into a separate preset, I could have the meeting trigger enable/disable that preset. I'll let you know if this works.

Unfortunately nothing released yet but I have started work on binding the "specific app did activate" to a app or CAG. So it will become possible soon.

Right now I think it could only be done via some scripts that disable the trigger on demand (using the update_trigger call).

Ok. I'm looking at the docs at Using Apple Script · GitBook

Are you suggesting I somehow get the named trigger i want to disable, and the adjust the following setting on it? I assume I can use AppleScript to do this?

  "BTTEnabled" : 1 // or 0?

If you have time, would appreciate a code sample. Thanks.

Got this working - thanks for the advice on scripting!

I have the opposite of this when the CAG for "meeting mode" activates.

tell application "BetterTouchTool"
    # Enable meeting focus fix	
    update_trigger "405AF69F-C6A1-4B8B-A02A-C56C7204C5B6" json "{\"BTTEnabled\" : 1, \"BTTEnabled2\" : 1}"
    # Disable normal focus fix
    update_trigger "3E56319C-9CC9-4A61-ADFD-4A503A0A5A4F" json "{\"BTTEnabled\" : 0, \"BTTEnabled2\" : 0}"
end tell

Better solution is now to use the built-in Advanced Trigger conditions within each action. So you can move the conditions from a CAG group into the action settings.