Integration with Keyboard Maestro

General discussions about LaunchBar
macdrifter
Posts: 4
Joined: Sat Mar 20, 2010 3:02 am

Integration with Keyboard Maestro

Post by macdrifter » Fri Feb 04, 2011 2:47 pm

The integration of Launchbar with Keyboard Maestro could bring some real power to the Mac. Much needed power if Quicksilver is going to find a successor. I've contacted the Keyboard Maestro devs and they tell me there are already hooks for Launchbar to use if the Objective Development wanted to add them:
...I'd be happy to make all the currently available macros available to Launchbar for them to use if that was something they wanted to display. You'd have to ask them if they want to display them.


This just seems like a natural integration. Launchbar can do a lot, by Keyboard Maestro fills a lot of gaps that would take significant Applescripting to do in Launchbar. Of course there is a workaround to make a bunch of Applescript files that call Keyboard Maestro macros but that's an ugly hack.
I hope the developers read this forum. I know this thread exists else where in the forum, but that thread devolved into a conversation that was non-productive and dev or moderator never chimed in with a comment.
I'm new to this forum and it does not seem obvious that the devs provide feedback to threads that often, so please comment if you think this is a worthwhile integration.

signupsammy
Posts: 12
Joined: Mon Mar 15, 2010 5:37 am

Re: Integration with Keyboard Maestro

Post by signupsammy » Fri Feb 04, 2011 9:38 pm

+3 for this. Love me some Launchbar. Love me some Keyboard Maestro.

blafusel
Posts: 6
Joined: Thu Apr 17, 2008 5:55 am
Contact:

Re: Integration with Keyboard Maestro

Post by blafusel » Sun Aug 07, 2011 7:29 pm

+3 from me too. that would be amazing!

aekorps
Rank 1
Rank 1
Posts: 33
Joined: Tue Sep 13, 2011 11:20 pm

Re: Integration with Keyboard Maestro

Post by aekorps » Wed May 29, 2013 9:15 pm

+1 from me

Was
Rank 2
Rank 2
Posts: 70
Joined: Wed Jan 13, 2010 2:27 am

Re: Integration with Keyboard Maestro

Post by Was » Wed May 29, 2013 9:44 pm

+1 from me, this would be brilliant!

iaj
Posts: 8
Joined: Mon Jan 16, 2012 6:22 pm

Re: Integration with Keyboard Maestro

Post by iaj » Fri Jun 14, 2013 9:01 am

+1 +1 +1
:mrgreen:

Nik
Rank 1
Rank 1
Posts: 20
Joined: Wed Dec 06, 2006 12:37 am

Re: Integration with Keyboard Maestro

Post by Nik » Fri Jun 14, 2013 9:58 pm

*bump*

+1!

andrej
Posts: 3
Joined: Sun Jun 16, 2013 9:37 am

Re: Integration with Keyboard Maestro

Post by andrej » Sun Jun 16, 2013 9:39 am

+3 for this. Yes!

jsturtridge
Posts: 15
Joined: Fri Jan 23, 2009 1:46 pm

Re: Integration with Keyboard Maestro

Post by jsturtridge » Mon Jun 17, 2013 10:59 am

Ditto; this would be fabulous.

Was
Rank 2
Rank 2
Posts: 70
Joined: Wed Jan 13, 2010 2:27 am

Re: Integration with Keyboard Maestro

Post by Was » Thu Jul 04, 2013 2:08 pm

Devs, any comment? It's been nearly 2 and a half years since the original request...

dbyler
Posts: 9
Joined: Fri Nov 09, 2007 6:07 pm

Re: Integration with Keyboard Maestro

Post by dbyler » Tue Jul 09, 2013 5:40 pm

+1

Kicweed
Rank 1
Rank 1
Posts: 23
Joined: Sun Nov 09, 2008 3:25 am
Contact:

Re: Integration with Keyboard Maestro

Post by Kicweed » Thu Dec 05, 2013 10:41 am

I'm not beating a dead horse here, I've possibly found something really useful.

Someone has integrated KM with Alfred and has open sourced his approach. It might have useful bits that we could use to integrate KM with Launchbar.

He seems to be using AppleScript to get the available macros from KM and then he parses them into Alfred's database with PHP.

Though I'm not well versed in Alfred's innards nor in PHP, but the whole process seems quite simple to adjust for Launchbar.

jimmyhartington
Posts: 2
Joined: Thu Dec 05, 2013 9:47 pm

Re: Integration with Keyboard Maestro

Post by jimmyhartington » Thu Dec 05, 2013 9:50 pm

I just also read the article about integration with Alfred (by the way of Gabe, which started this thread :D ).
And thought this could be nice for Launchbar.

Unfortunately I do not have the skills to make it from the opensourced materiale, so I hope the developer will jump on this to make it happen.

So +1 from me.

Kicweed
Rank 1
Rank 1
Posts: 23
Joined: Sun Nov 09, 2008 3:25 am
Contact:

Re: Integration with Keyboard Maestro

Post by Kicweed » Fri Dec 06, 2013 3:37 pm

I've had a look through the source code. I think I've got the steps sorted:

1. info.plist: It's the place where it all starts and ends. On line 43 it runs main.php with the user's query as the parameter:

Code: Select all

/usr/local/bin/php -f main.php -- "{query}"


2. main.php: On line 30 it runs km.scpt to get from KM the available macros details (name & hot keys, I think). Then, it finds which macro name best matches the user's query and returns that name back to info.plist.

3. info.plist: On line 68 it tells KM to run the macro with the name returned by main.php.


The above is a trivial process, the only problem is how to bring the list of available macros inside LB's index. Alfred queries KM every single time the action is run, by using 2 different languages (PHP and AppleScript). This is not practical and it would slow LB down. The PHP part could be avoided altogether if LB can automatically scan and index KM's macros. Also, parts of what main.php does can be done much better by LB i.e. the name matching.

I'm not on my Mac right now so I don't know how easy that would be. According to the official KM wiki, the macros are stored in a .plist file. It shouldn't be that hard to parse it and include it in the index. Running the macros is a 3 line AppleScript call:

Code: Select all

tell application "Keyboard Maestro Engine"
  do script MacroNameString
end tell

Was
Rank 2
Rank 2
Posts: 70
Joined: Wed Jan 13, 2010 2:27 am

Re: Integration with Keyboard Maestro

Post by Was » Sun Dec 08, 2013 1:29 pm

Any chance the devs could implement this officially for the next release of Launchbar?

Post Reply