Replace Inquisitor in Safari 4 Beta with TextExpander
The only thing I miss about Safari 3 was its compatibility with Inquisitor. Inquisitor is a web search tool that lets you add custom, keyboard accessible searches to Safari’s Google Search Box. (I’ve written about Inquisitor in the past.) Safari 4 Beta has changed the way input managers talk with the browser, and for all the beauty and utility of Inquisitor, the addon is essentially a hack. No fault of Apple’s for breaking hacks in major upgrades to their software.
Safari 4, however, has added some of its own functionality to the Google Search Box by way of ‘as you type’ search suggestions that, if selected, will bring up a Google search page with the selected results. About the new functionality, Daring Fireball writes:
The Google search field now populates the suggestion menu as you type with results from Google’s Suggest feature. For me at least, the suggestions are remarkably, almost spookily, good.
I agree with Gruber that the search suggestions are a significant new feature. But the fact remains that Inquisitor, which, again, let you search user defined engines without detouring through Google, is dead and gone. I’ve been grieving its loss.
Until today, that is. The idea struck me that TextExpander from Smile on My Mac can be rigged to let you search custom search engines from Safari’s location field, rather than the Google Search Box.
What’s TextExpander?
TextExpander is a typing assistant which lets you expand custom text abbreviations into longer, often used text snippets. For instance, if you find yourself replying a lot of emails in the same way, type your reply once in TextExpander and assign it an abbreviation. The next time you need to write that same email again, just type the abbreviation and TextExpander will expand it out for you. The powerful little preference pane will significantly reduce what Merlin Mann refers to as “idiotic typing time.” It’s 29.95 USD.
Using TextExpander to Perform Custom Web Searches
Each time you search a site a unique URL is generated which relates to your search terms. For instance, if you want to search Twitter, go to http://search.twitter.com/ and enter your search terms. I’ll use Mac Mini for my example. A search for Mac Mini will generate the URL http://search.twitter.com/search?q=mac+mini. It’s fairly easy to see how to perform a custom search from the Location bar by looking at this URL – just enter search.twitter.com/search?q= and then type your search terms. But as easy as it might be to understand how to search specific sites from the Location Bar, actually doing so requires an amount of manual labor (i.e., typing) that I’m not willing to complete. Here is where TextExpander comes in.
Go to a site that you often search and search for something. Have a look at the resulting URL. I’ll do a search on Flickr for “snow leopard.”
Next, highlight only the base URL and the search syntax up to your search terms as shown in the above screen shot (in my testing with various sites, everything after your search terms in the URL isn’t necessary to perform the location bar search Update: It is possible set up searches for URLs that have important search parameters after the search terms by using TextExpander’s “Position Cursor Here” command. Please see my response to Patrick in the comments for more details). Now go into TextExpander’s menu bar item and select “Create Snippet From Selection.”

TextExpander’s preference pane will open and from here you can add your snippet title and the abbreviation you want to use to expand it. For Flickr I’m using ’ssf’ (my choice here is motivated by the need to remember a few different search snippets: Google images will be ’ssgi,’ Delicious, ’ssd,’ etcetera). Have a look at the screenshot:

Your new Custom search is now set up and ready to use.
Using Your Custom Searches
The hard part is setting your new custom searches up (and that’s not too hard); the easy part is using them. Open up Safari and select the Location field (Command + L by default). Now type your abbreviation (’ssf’ if you’re following my Flickr example). After TextExpander expands your search URL, simply type your search terms and hit enter. If everything goes to plan, Safari will do the rest of the work (adding %20 between your search terms if your search is multiple words) and open up your results.
Here’s a video of the entire process from Snippet creating to performing your custom searches.
One of the best parts of using TextExpander to perform your custom searches is that you can have your cake and eat it too – that is, you don’t have to give up Safari’s new search term completion in the Google Search Box to perform your custom searches. Moreover, because TextExpander is a stand alone application and not a Safari hack, it should be more future proof and won’t break with the next release of Safari.
March 6th, 2009 at 9:16 pm
The problem with this approach is that it only works with search URLs that have the search term at the end but there are several search URLs which let you pass in some parameters (e.g. forum searches) and those usually are appended to the search term.
I don’t know if you’ve tried TypeIt4Me but this text expander has a feature called AutoCue where you can specify a certain template for abbreviations:
“You can now define boilerplate templates where a few bits need to be different from time to time. TypeIt4Me will expand up to the bit that requires your variable text input and prompt you (cue you) for what it is you are supposed to type. It will then wait for you to type the text and continue with the next bit of expansion when you press TAB.”
It’s kind of like TextMate snippets. I requested this feature several months ago for TextExpander and the developers responded that they consider it but unfortunately they haven’t incorporated it yet.
If there was an easy way to migrate all my TextExpander snippets to TypeIt4Me I would instantly switch because I think this feature has a lot of potential.
March 7th, 2009 at 5:30 am
Jean from SmileOnMyMac here. Thanks for this tip–I hadn’t thought of doing this, and it would be a big help. :-)
@Patrick: TextExpander and TypeIt4Me both support importing of each other’s snippets, just so you know.
March 7th, 2009 at 8:33 am
@Patrick: Your comment made me realize that TextExpander does support mid-point insertion for your snippets in the form of a “Position Cursor Here” command.
For instance, to set up a search of your own Delicious bookmarks, the URL has some search parameters after the point in the URL where the search terms are. Here is a search for “applescript safari” in my bookmarks:
http://delicious.com/search?p=applescript%20safari&u=Peter_Verkhovensky&chk=&context=userposts&fr=del_icio_us&lc=1Without the user parameters (“u=Peter_Verkhovensky” and the rest of it) the URL would search the whole of Delicious and not narrow itself down to my bookmarks alone. To set up the user constrained search using TextExpander, import the entire URL and delete only the search terms (in the above example “applescript%20safari”) and you can have TextExpander place your cursor in the appropriate place for your to perform the search (the position cursor command is in the “+” dropdown menu next to the Label box of the new snippet preference pane). Maybe not as powerful as AutoCue in TypeIt4Me (which I’m not familiar with) but useful enough to search more complicated URLs. Thanks for the helpful comments.
@Jean MacDonald: Thanks for stopping by, and for your hard work on TextExpander.
May 13th, 2009 at 7:00 pm
Hey! For me Stand (http://hetima.com/safari/stand-e.html) still works in Safari Beta 4. It gives you next to other things this customizable search option. For example I can type “gl hat” and it will do a google lucky search.
June 10th, 2009 at 4:13 am
I also use Safari Stand for these custom searches and it works great. Stand has a bunch of other options too, one which I like closes the Downloads window after downloads are finished.
July 5th, 2009 at 7:52 pm
hi
I have kinda problem
my Abbreviatins are leaving the first letter before the actual snippet
i.e. shttp://www.csfd.cz/hledani-filmu-hercu-reziseru-ve-filmove-databazi/?search=
do you have a tip for this?
thx
July 6th, 2009 at 5:44 am
@bbelo Can you send a note to the TextExpander support team at textexpander@smileonmymac.com? That’s the best way to get help with TextExpander.
July 6th, 2009 at 7:38 pm
Hi Michal,
Is this occurring only in Safari? We’ve noticed an issue with TextExpander and autocompletion of URLs. We’re not sure what to do about it given that the characters automatically added in the autocompletion do not transit the standard keyboard filter.
Thanks for using TextExpander from SmileOnMyMac!
Regards,
Greg
TextExpander Support
September 26th, 2009 at 12:43 am
i like the design of Safari 4 but i think it uses more resources compared to Opera.
September 28th, 2009 at 11:02 pm
Safari 4 is a bit slow compared to either Opera and Firefox. but i like the interface and graphics of Safari 4, it is cool though.
October 13th, 2009 at 11:17 pm
i really love the layout of Safari 4. the graphics of this browser looks much better than firefox.
October 13th, 2009 at 11:47 pm
glimmer blocker does this far more better :)