Automatically move mouse to the center of the focused application whenever it changes

Swish has a menubar app switcher. (Tap and hold to invoke the scrollable system app switcher or swipe left/right to directly activate the previous/next app.)
BetterTouchTool has some functions that can move mouse to the center of the active window. (Most of the time it doesn't work properly. Move mouse to the very bottom or very top or somewhere else.)

Combine these two can do something I want.

  1. Two fingers tap the menubar.
  2. Focused application changes.
  3. Move mouse to the center of the current application.

But BetterTouchTool is always one application behind. Move mouse to the center of the previous window.

How can I do it by using KM?
I have some ideas right now, but I don't know to make it.

  1. When Swish app switcher is triggered. BTT trigger KM.
  2. KM gets the current window size.
  3. KM does some math to find out the center.
  4. Move mouse to the center.

This is too hard for me to make a maestro. Any help or suggestion would be appreciated.

I know I didn't articulate my thought really well since I am not quite familiar with English. Sorry for the trouble understanding.

1 Like

I'm not familiar with Swish, but regardless of how you switch between apps, you can have KM move the mouse to the center of the current app's front window more easily than you might think, as that functionality is already built into the action used to move the mouse:

Auto-Move Mouse to Center of Focused App.kmmacros (3.0 KB)

1 Like

In my experience one is usually only switching between 5 - 10 apps,
so whilst using the above from gglick for the rarer apps, why not just define a hot key trigger in KM e.g. CTL+CMD+G activates google chrome?