Activating LaunchBar with a device key

I'm trying to make Caps Lock a "search" key, a la Chromebooks. To this end, I have it set to open up Launchbar by clicking the activation keyboard shortcut in the app.

I'd rather have NO activation shortcut, because that makes me feel more "pure" somehow, but if I just activate the app or otherwise launch it, it will open in the screen and in the space that it was last focused on, as opposed to the hotkey which opens it up in situ, as it were.

Anyone know if there's a way I can force LB to open its search window on the current monitor and space?

CapsLock is a special key, use Karabiner Elements to help KM recognize this device key.

That's not the issue - I'm just using device key to fire off LB on a capslock press (and deactivated it in KB prefs). It's controlling the behavior of LB that I'm dealing with.

I'm confused about what exactly you wanna do.
Maybe you just need this AppleScript:

tell application id "at.obdev.LaunchBar"
	activate
end tell

Here's the scenario: I have multiple monitors and spaces. When an app is activated, it switches focus to the screen and space that app's frontmost window is active in. LaunchBar does the same thing, so when I activate it via KM, its icon, or a script, it switches to whatever screen/space it was last used.

LaunchBar has special behavior that when you activate it via its hotkey, it will pop open its search bar in the currently focused space and window. (Just like Spotlight does)

I'm trying to make it behave like the hotkey without using the hotkey.

Try this, it works on my MacBookPro13 mid 2018 and Dell P2416D.

tell application id "at.obdev.LaunchBar"
	(reopen) & show
end tell

Tested on Desktop 1、Desktop 2、internal monitor and outside monitor.

1 Like

The "& show" throws an error. This does the job:

tell application "LaunchBar" to reopen

Thank you!

Well, show didn't work anymore.

I prefer to use bundle id:

tell application id "at.obdev.LaunchBar" to reopen