Running an app and triggering a shortcut flawlessly

Been trying to figure this out for a while. I set up a keyboard shortcut in BTT to trigger an action but BTT is not always running on my Mac.
I need a macro that can take the same keyboard shortcut, run BTT in the background if not already running and trigger the action.
If BTT is already running, it simply triggers the action.

I have not been able to get the macro to run flawlessly. Any help is appreciated.

You haven't said what the action is, so it might be more efficient for KM to perform it natively. However, assuming it's something that can't be done in KM...

The action is to keep an app window floating in front of other apps and focused at all times. "Pin/Unpin Focused Window To Float On Top" is the BTT action.

Hi @Zirm, here is the macro you want. If BTT is not running in the background, it will be started and then your BTT action will be executed. If BTT is already activated, your desired BTT action will be executed. I would recommend you to execute the BTT action via an AppleScript (green here) because this can save you many shortcuts. Of course, you can also work with a macOS shortcut.

BTT float window <3329 220630T212436>.kmmacros (37,4 KB)

BTT float window <3329 220630T212436>

Create the BTT action and copy the BTT UUID (red arrow) and replace the UUID in my AppleScript.

2 Likes

Thanks. Perfect!

1 Like