Help with syntax for calling services

Sharing and discussing custom search templates for LaunchBar
Post Reply
Nik
Rank 1
Rank 1
Posts: 20
Joined: Wed Dec 06, 2006 12:37 am

Help with syntax for calling services

Post by Nik » Wed Dec 06, 2006 12:42 am

I really like the new feature in the beta to send a string directly to a service. Unfortunately, I can't seem to get it to work for items in sub-menus of the services menu. For example, I tried to set up one for TextEdit to create a new document with the passed string:

Code: Select all

x-launchbar:perform-service?name=New+Window+Containing+Selection&string=*


This search template appears to not do anything.

I'm having no trouble with the entries in the root menu. That seems to work fine. But sub-menus are often where the action's at as many (most?) applications group their services together.

norbert
Objective Development
Objective Development
Posts: 648
Joined: Thu Nov 09, 2006 6:30 pm

Post by norbert » Wed Dec 06, 2006 12:59 am

The name of the service must be preceded with the sub-menu title, separated with a slash character:

Code: Select all

x-launchbar:perform-service?name=TextEdit/New+Window+Containing+Selection&string=*

A similar example can be found in the LaunchBar Help, chapter "Search Templates"

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

Post by Nik » Wed Dec 06, 2006 3:28 am

And here I was assuming y'all hadn't updated the documentation yet since it was just a beta. Now I know better!

Thanks for being so nice in an RTFM reply. :)

beerich
Rank 4
Rank 4
Posts: 161
Joined: Thu Apr 05, 2007 11:05 am
Location: Toronto

<- dufus

Post by beerich » Tue Jul 10, 2007 1:15 pm

Hi guys. Sorry if I don't even know where the manual is, but I'm completely lost with what you are mentioning here.

Any chance you could point me in the right direction to read up on this stuff? I live in Launchbar, think it's excellent stuff.

Cheers

sampler
Posts: 14
Joined: Mon Mar 12, 2007 2:49 am
Location: Hudson Valley, NY

Post by sampler » Wed Jul 18, 2007 5:45 pm

BeeRich-

Look in LaunchBar Help (CMD-?) in the Help Menu. The "Search Templates" item is in the Configuration section. The Services Menu it talks about is under the app menu (one to the right of the apple menu) for any app which can use Services. Services are described in the OS X help. You can download a very handy free bunch from devonthink. Many apps, like NoteTaker, Yojimbo, will provide their own.

http://www.devonthink.com/download/index.html

bottom of the page.

sampler

beerich
Rank 4
Rank 4
Posts: 161
Joined: Thu Apr 05, 2007 11:05 am
Location: Toronto

Templates

Post by beerich » Thu Jul 19, 2007 11:38 pm

Very good. Thanks for the info. I'll take a look.

bumpi
Posts: 14
Joined: Mon Apr 23, 2007 7:29 pm

Post by bumpi » Fri Aug 03, 2007 10:39 pm

Can someone provide an example of using the Services menu via LB? The services menu items do not show up in my configuration, so perhaps that's why I'm having trouble.

sjk
Wizard
Wizard
Posts: 315
Joined: Thu Sep 13, 2007 9:46 pm
Location: Eugene
Contact:

Post by sjk » Thu Sep 13, 2007 11:49 pm

bumpi wrote:Can someone provide an example of using the Services menu via LB? The services menu items do not show up in my configuration, so perhaps that's why I'm having trouble.

I'm interested in this feature, too. So far I've noticed this in the Release 4.2 beta 1 notes:

• Services menu support: It's now possible to invoke arbitrary commands from the Mac OS X Services menu via search templates. The The [sic; typo] default configuration contains an example template that invokes the Look Up in Dictionary service of Dictionary.app (you can add the latest defaults by clicking New > Search Templates > Factory Search Templates).

And in my freshly installed 4.3.2 configuration I found the Look Up in Dictionary item in the Name list of Search Templates (UTF-8) under Indexing Rules, with this Details field:

x-launchbar:perform-service?name=Look+Up+in+Dictionary&string=*

I still haven't figured out how to actually use this since I'm still new to LB.

Post Reply