Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Creating custom services with TextWielder System
Text Wielder is a "super services" application that includes about 120 different predefined actions. As a brief example, Text Wielder services can search for song lyrics, clean up email formatting, or get a map of a particular city or zip code. And since Text Wielder runs as a service, it's available to all Cocoa apps and a few Carbon apps (hopefully more in the future!).

One of the coolest things, though, is that you can use Text Wielder to write your own services. As an example, read the rest of the article for a step-by-step guide on creating a "Search macosxhints.com" service item for Text Wielder. This guide was contributed by Eric Blenkush, the author of Text Wielder.

If you would rather not create the "search macosxhints.com" service yourself, you can simply download it. Otherwise, read the rest of the article for Eric's great step by step guide...

Creating the service:
  1. Open the Text Wielder application (in /Applications/Text Wielder).

  2. Select New SFRL Script from the File menu.

  3. Insert the following text into the Find field, making sure you do not add any newline characters:
    This simply gives a name to the input (the text you select) of the service. For more advanced purposes you can use regular expressions. See the Text Wielder Help for more info.
    

  4. Now insert the following text into the Replace field:
    http://www.macosxhints.com/search.php?query=
    &mode=search&datestart=0&dateend=0&topic=0&type=stories&autho=0
    NOTE: Enter as one line without any spaces! This is the same URL you use to search macosxhints.com with one exception. Where your search text would normally be we see . This code prepares your input for use in a URL and places it in the correct location.

  5. Select Open as URL from the Service Action pop-up menu on the SFRL window.

  6. Press the Compile button on the SFRL window.

  7. Save your new service in the My Scripts folder in the Text Wielder folder.
That's it; the new service is now created and saved!

Testing the service:
  1. From a service-enabled application (e.g. TextEdit, OmniWeb, Mail), select some text to use for your search on macosxhints.com.
  2. Under the application's menu, select the menu item Services -> Text Wielder -> Choose Service. An open file dialog will appear. Use the open file dialog box tonavigate to the SFRL script you just made and then click the Open button.
The service will run and your web browser will open a new window searching for your selected text on macosxhints.com. Once you're sure the service works, you can add it to the normal Text Wielder services list.

Adding the service to the service menu:
  1. Open the Text Wielder application.
  2. Select the menu item Tools -> Service Manager. The service manager window will appear.
  3. Click the Add button. An open file dialog will appear.
  4. Use the open file dialog box to navigate to the SFRL script you just made and then click the Open button. The service will be added to the menu. You will need to re-login for it to appear in the menu.
If you make any cool services, please send them to Eric Blenkush, and he'll include them in the next Text Wielder distribution.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,983 views]  

Creating custom services with TextWielder | 4 comments | Create New Account
Click here to return to the 'Creating custom services with TextWielder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
JavaScript?
Authored by: saint.duo on Feb 17, '02 11:15:58AM

Anyone know how to turn that search into a quick javascript? Put in in the IE toolbar, click it, enter a search term, and let it go. I saw something once that did it with Google, but have since lost the source code for it.



[ Reply to This | # ]
Textwielder
Authored by: ret on Feb 17, '02 08:41:46PM

I use TextWielder - if only the Finder would talk to it!

Whilst I appreciate the application was just an example, I'd much prefer a Sherlock plug-in for MacOSX Hints. How about it?



[ Reply to This | # ]
Textwielder
Authored by: bhines on Feb 18, '02 12:48:33AM
Well, ret, of course TextWielder can talk to the Finder, just not the other way around. You can put applescript in TextWielder per my previous tip here about Text Wielder. Applescript w/TW

[ Reply to This | # ]
Textwielder
Authored by: ret on Feb 18, '02 07:59:16PM

Er, I meant Finder -> TW :-/

Thanks for the tip



[ Reply to This | # ]