Using LaunchBar with Chrome Bookmarks

###How Can I invoke the Chrome Extension Bookmark Search from LB?

I love how this Chrome Bookmark Search extension works -- much better than the built-in search. But I need a quick and easy way to invoke it.

I'd love to do this:

  1. Trigger LB
  • Type "BMS" for Chrome BookMark Search
  • Press SPACE and enter my search terms, including spaces
  • Press RETURN to execute in Chrome.

But, AFAIK, this won't work because

OK, next best option, is to open Chrome to a new tab with the cursor in the Address Bar (Ominibox) from LB. Is there a way to do this?

P.S. I fully realize this is the KM forum and not the LB forum, but the response here is far better. So thank's, @peternlewis, for indulging us. :wink:

Until/If I can figure out how to do this in LB, here's my KM Macro that gets the job done!

###MACRO:   @Chrome Open Chrome to @Bookmark @Search Bar

~~~ VER: 1.0    2017-05-31 ~~~

####DOWNLOAD:
@Chrome Open Chrome to @Bookmark @Search Bar.kmmacros (2.6 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


###Use Case

  • Open New Tab in Chrome
  • Invoke the Bookmark Search Extension
  • Ready for me to type my search terms

I'm trying to figure out a way to trigger this macro from LB, but it doesn't fully work.

Issues:

  1. I can't assign a shortcut to the macro in LB
  • So it takes too many steps to find the KM macro in LB
  • It does trigger the macro, but LB traps the keystrokes from the Macro, even when I put in a 1 sec pause.

I love LB, but sometimes it is very frustrating.

Hi JM,

this is your KM macro as AppleScript (improve it if necessary):

-- LaunchBar Action Script

tell application "Google Chrome"
  if (count of windows) < 1 then
    make new window
  else
    tell window 1
      make new tab
    end tell
  end if
  activate
end tell
tell application "System Events"
  keystroke "l" using command down
  keystroke "bm\t" 
end tell
  1. Open the Action Editor
  2. Create a new action, e.g. with the name “Chrome Bookmark Search”
  3. Choose AppleScript as Default Script
  4. Click Edit button
  • default.scpt will open in Script Debugger (or Script Editor)
  1. Delete the content and paste the script from above
  2. Save and close the script file.

Bring up LaunchBar, type cbs (or whatever corresponds to the name of your action), focus the action, press Return.

Repeat this once or twice to make LB learn your preferred abbreviation, or – if you’re really inpatient – force-assign an abbreviation with ⌥⌘A.


###PS:

If you prefer to type the search string in LaunchBar (instead of Chrome’s address field), then get the input string from the handler:

on handle_string(_string)
  tell application "Google Chrome"
    if (count of windows) < 1 then
      make new window
    else
      tell window 1
        make new tab
      end tell
    end if
    activate
  end tell
  tell application "System Events"
    keystroke "l" using command down
    keystroke "bm\t" & _string
  end tell
end handle_string

(I would probably prefer this, since it also allows you to send a text selection to the action (Instant Send). You can still modify your search in Chrome afterwards.)

Adjust the action properties accordingly:

1 Like

Wow! Works great, @Tom! :+1:

Many thanks for providing a great solution, and great instructions.

I keep telling you, LB should hire you for documentation and support.

EDIT: BTW, I took your suggestion and when with the last script: