Show "Window Switcher Active App" for non active Apps

Hi Andreas,

I am wondering if it would be possible with BTT to show the "Window Switcher Active App" for non active Apps? E.g. my active App is Outlook and I want the Window Switcher to show me all Finder Windows.

UseCase idea:

  • Mouse Wheel Scroll or Trackpad Gesture on App Icon (in the Dock) to open Window Switcher for the corresponding App
  • select the right Window
  • focus the selected Window

Thanks for your feedback and have a great day.

Best regards,
Volker

you can use the "Show WIndow Switcher For All Apps" action and use a regex like this:

^(?!Safari-).*$

This would exclude all apps except for Safari

2 Likes

Ah okay, thanks.

Thinking loud: I guess I would need to set a variable when hovering an icon in the Dock an use this variable in the regex to make it work universal!?

I'll give it a try.

best convert to a javascript action (right-click, convert to js)

async function transformedActions() {
  let result = undefined;

  result = await trigger_action({
    json: JSON.stringify({
      BTTIsPureAction: 1,
      BTTPredefinedActionType: 100,
      BTTPredefinedActionName: "Show Window Switcher for All Open Apps",
      BTTAdditionalActionData: {
        BTTWindowSwitcherHeight: 500,
        BTTWindowSwitcherItemHeight: 30,
        BTTWindowSwitcherWidth: 380,
        BTTWindowSwitcherOverrideDefaultShortcuts: false,
        BTTWindowSwitcherShowThumbnail: 1,
        BTTWindowSwitcherExcludeHiddenAndMinimizedWindows: false,
        BTTWindowSwitcherDisableMouseHover: false,
        BTTWindowSwitcherExcludeAllButHiddenAndMinimizedWindows: false,
        BTTWindowSwitcherSelectNextOnRepeat: true,
        BTTWindowSwitcherExcludeSpecific: true,
        BTTWindowSwitcherInitialFocus: 0,
        BTTWindowSwitcherTriggerOnRelease: false,
        BTTWindowSwitcherFocus: 0,
        BTTWindowSwitcherShowPopover: 0,
        BTTWindowSwitcherAppearance: 0,
        BTTWindowSwitcherExcludeVisibleWindows: false,
        BTTWindowSwitcherFontSize: 12,
        BTTWindowSwitcherExclude: "^(?!Safari-).*$",
        BTTWindowSwitcherSort: 0,
        BTTWindowSwitcherExcludeWindowsFromOtherSpaces: false,
        BTTWindowSwitcherMousePos: 0
      }
    }),
    wait_for_reply: true
  });

  return true;
}

However currently you'd need to parse hovered_element_details variable to get the app name. In 6.300 I have added a new integrated variable "hovered_dock_app_name" so the JavaScript can now look like this:

async function showWindowSwitcherForHoveredDockApp() {
let hoveredDockAppName = await get_string_variable("hovered_dock_app_name");
  let result =  = await trigger_action({
    json: JSON.stringify({
      BTTIsPureAction: 1,
      BTTPredefinedActionType: 100,
      BTTPredefinedActionName: "Show Window Switcher for All Open Apps",
      BTTAdditionalActionData: {
        BTTWindowSwitcherHeight: 500,
        BTTWindowSwitcherItemHeight: 30,
        BTTWindowSwitcherWidth: 380,
        BTTWindowSwitcherOverrideDefaultShortcuts: false,
        BTTWindowSwitcherShowThumbnail: 1,
        BTTWindowSwitcherExcludeHiddenAndMinimizedWindows: false,
        BTTWindowSwitcherDisableMouseHover: false,
        BTTWindowSwitcherExcludeAllButHiddenAndMinimizedWindows: false,
        BTTWindowSwitcherSelectNextOnRepeat: true,
        BTTWindowSwitcherExcludeSpecific: true,
        BTTWindowSwitcherInitialFocus: 0,
        BTTWindowSwitcherTriggerOnRelease: false,
        BTTWindowSwitcherFocus: 0,
        BTTWindowSwitcherShowPopover: 0,
        BTTWindowSwitcherAppearance: 0,
        BTTWindowSwitcherExcludeVisibleWindows: false,
        BTTWindowSwitcherFontSize: 12,
        BTTWindowSwitcherExclude: `^(?!${hoveredDockAppName}-).*$`,
        BTTWindowSwitcherSort: 0,
        BTTWindowSwitcherExcludeWindowsFromOtherSpaces: false,
        BTTWindowSwitcherMousePos: 0
      }
    }),
    wait_for_reply: true
  });

  return result;
}
2 Likes

For 6.300 I have added "Action Plugins" that can be created by selecting pre-configuredactions in BTT and right-clicking them.
Here is such a plugin to show the window switcher for the currently hovered app in Dock:

WindowSwitcherHoveredApp.bttjsonplugin (4.5 KB)

Once imported it will show up in the action selector:

1 Like

Thank you Andreas....I've sucessfully manged to import your plugin and hope I can iterate from there on my own. Amazing.

6.301 will also allow you to transform such a plugin back into the actions it consists of (by right-clicking the configured plugin action) in case they need to be modified.

1 Like

It's like you read my mind :smiley:

Can you help me with which of the rightclick options is transforming the plugin back into the actions?

Hi Andreas, do you have any hints on were to find this "transform such a plugin back into the actions it consists of" option? I cannot find it. (just checked with BTT 6.303)

it should show in the context menu, but for some reason doesn't always. For now I'm showing it unconditionally in 6.304. (however in case of the window switcher it will just transform to the underlying "Run JavaScript" action.

1 Like