Several weeks ago, two keyboard macros of mine started interfering and I cannot figure out how to prevent it

Hello BTT'ers,

I am a "power" keyboard user who uses keyboard shortcuts to directly open/launch apps constantly. This had been working perfectly in BTT until 3-4 weeks back.

Then, I was able to switch to my PWA "Gmail" app (created in Edge for mac via Hamburger menu (top right) → More Tools → Apps → Install Gmail) from Edge, and to switch back to Edge from Gmail at will, using the keyboard shortcuts ⌥⌘M for Gmail and ⌥⌘F for Edge.

However, a little while back, the following now happens:

Result 1:
Steps:

  1. I hit ⌥⌘F to switch to Edge
  2. I hit ⌥⌘M to switch to Gmail PWA

The Gmail app shows (which is correct) but only for a fraction of a second and then Edge replaces it in the foreground as the active app i.e. Gmail is switched to, but only for a fraction of a second, before switching back to Edge.

Result 2 (reverse of Result 1 basically) :

Steps:

  1. I hit ⌥⌘M to switch to Gmail PWA
  2. I hit ⌥⌘F to switch to Edge and the app shows (which is correct) but only for a fraction of a second and then Gmail replaces it in the foreground as the active app i.e. Edge is switched to, but only for a fraction of a second, before switching back to Gmail.

Here is the macro for switching to Gmail app (I can supply it via other means that BTT provides if necessary)

gmail-launch.bttpreset (2.1 KB)

And the macro for switching to Edge app

edge-launch.bttpreset (2.0 KB)

They both just do the following 3 steps:

except for the edge one, it launches Edge as step 1 obviously.

NOTE that if I comment out steps two and three, I can happily switch between edge and the Gmail PWA. However, because I have other keyboard bindings which switch to Gmail in another profile and edge in another profile I do actually need steps 2, and 3.


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

Macbook, keyboard


Screenshots

EDGE

Gmail

Note that since Gmail is a PWA "app" created by Edge, they both have the same Profiles menu by which I navigate to the correct user profile called "Gmail :inbox_tray:". But this has always been the case :thinking:


Device information:

  • Type of Mac: MBP M1 16" 32GB.
  • macOS version:Version 26.5.2 (25F84)
  • BetterTouchTool version: (please post the exact version - not just "the latest one"): 6.639

Additional information (e.g. crash logs, related issues, etc.):

I'm happy to provide any other diagnostic info necessary and am open to alternatives solutions.

Many thanks,

Peter

have you checked BTT's recently used section to see whether maybe something else is triggering? Your exported triggers seem to work fine on my machine.

Btw. I think if you install the pwa while you have selected the desired profile, the pwa will automatically switch to that when opened. Maybe that could save you the manual switch.

For me the PWA doesn't even have the Profiles Menu Bar item, are you sure this is there for you in the gmail pwa?

Hello again Andreas!

Yes, it was the first thing I checked and all is as expected. If you modify the routine to search for window; and then replace "Gmail :inbox_tray:" with your actual profile, maybe then it will exhibit the same behaviour if you have > 1 profile set up? And by the way, PWA's work in a semi dark-magic way. You can rename the binary or app whatever you wanna call it and it will still find them and so on so there's quite a bit going on under the hood in the profiles folder that wires all this stuff up together.

For example, if you were to switch to a different profile in Chrome or edge and then visit Gmail and then install the Gmail PWA, it would not create a second Gmail app, and then you would have two Windows, one per profile of the same app running. This is why I need to be able to switch to my Personal or work Email at the stroke of a Key same Goes for my Personal or work browsers. I hope that makes sense that's why I need these extra last two statements.

So if she really want to replicate, just go to Gmail in a different Chrome profile and open it in the PWA and you should see the observed behaviour once you have modified the macro to match your profile name. And finally, yes, I am 100% sure that the PWA has a profile's menu because that's what the second screenshot shows :slightly_smiling_face:

Cheers, Peter

very strange, I can't get my gmail PWA to show the profiles item (I have multiple profiles but my PWAs don't show the profile selection). Do you have any idea how you got that to appear? :sweat_smile:

Yes, try the following:

  1. In profile A, navigate to mail.google.com and press enter. If the options to open an existing PWA is in the address bar, click it so that it opens, else choose the menus I mentioned in my initial post to create a PWA for Gmail
  2. Then go back to your browser and switch to a profile B window. create a new tab and go to mail.google.com and you should see that you can open the PWA from the address bar. Do this. You should now - if you switch to the Gmail PWA and show all app Windows, see two individual Gmail windows as well as the profile menu being visible.

Please let me know if that is not what happens. It's worth noting that I am using edge for Mac rather than chrome, but I distinctly remember Chrome behaving this way too. I can also whip up a screen recording for you. Cheers.