How to Pass a LaunchBar String Input to Keyboard Maestro?

Hello.

Trying to set up a basic KM macro that is triggered via a LaunchBar action with the idea that the input string (LaunchBar input) should be passed onto the macro.

This is my current attempt where I am copying the input string to clipboard and pasting it in the macro:

LaunchBar Action's AppleScript:

-- LaunchBar Action Script

on handle_string(theString)
	set the clipboard to theString
	
	tell application "Keyboard Maestro Engine"
		do script "9026166A-0EB6-4185-87C8-BC747ED093D7"
		-- or: do script "Search Nimbus Note"
		-- or: do script "9026166A-0EB6-4185-87C8-BC747ED093D7" with parameter "Whatever"
	end tell
end handle_string

Above works ok but I am wondering how I can do the same w/o using the clipboard.

I think it is something along the lines of:

If it is really that important to you, I guess you could use LB with a custom Action that takes your input and then triggers a KM macro, passing the input as a parameter to the Macro. Then use the %TriggerValue% token to read the parameter.

or Passing filenames from LaunchBar to KM-Macro - #3 by snapitup.

Thanks,
Sridhar.

Got it.

In the LaunchBar AppleScript:

make variable with properties {name:"Input String", value:theString}

Then in KM:

image

If there's anything that could be made better, please share.

Hi @Sridhar, it's not in Launchbar, but maybe it only works with KM :wink:

Nimbus Find... <6618 201108T053429>.kmmacros (41,0 KB)

Just give it a try. So that your macro is not so susceptible to interruptions. Please pay attention to the actions from "Activate Nimbus Note" in my macro.

Thanks for sharing.

I prefer typing ns for note search in LaunchBar to remembering ⌘Y. LaunchBar is pretty much my main control center and I just want to remember ⌘+Space to bring it up and type aliases or text to do what I want.

1 Like

I give you right @Sridhar. I myself also use a lot of actions, also in KM, with Launchbar 6.

From your contribution I can see that you are now running it. Could you share the complete AppleScript for Launchbar. I would also like to use your workflow. Thanks a lot.

I shared the details at https://webnolo.com/custom-key-bindings-and-command-palette-in-nimbus-note/.

1 Like

Thank you @Sridhar for sharing this article. I will now have a lot of work to do to change my Search Macro's to use with Launchbar :wink: