I'm finally using Quicksilver, and yes, it is making my life easier. Today I wasted spent about an hour figuring out how to do a google search directly from the command window. Having gotten that to work, I thought, you know, the other thing I need is a Leo autosearch. So I set one up! By myself! Bwahaha. It would be neater still if there were a German-English-German DEF plugin, or I guess it would be TRANS...but this will do for now.
Comments
You are so smart. You have to show me how you did it.
Posted by: Andrew at December 16, 2004 04:43 PM
If I can remember, I'll be happy to.
Posted by: Heather at December 16, 2004 04:48 PM
This AppleScript will take a little more editing to use with QS (personally I call it from a tiny Big Cat script), but not too much. Searches Google plus half a dozen online German-English dictionaries. I use OmniWeb, but it's not hard to adapt for Safari either.
property dictList : {"http://www.google.com/search?q=*", ¬
"http://www.iee.et.tu-dresden.de/cgi-bin/cgiwrap/wernerr/search.sh?string=*&nocase=on&hits=50", ¬
"http://www.linguatec.net/etsonline/wortsuche.cgi?l=0&dt=*&en=&neu=1&lem=1&sel=0&dtalt=&enalt=", ¬
"http://www.e-woerterbuch.de/php/Ausgabeseite.php?Anfragewort=*", ¬
"http://dict.uni-leipzig.de/index.php?wort=*&anzahlen=on&fuzzy=on&x=70&y=13", ¬
"http://wb.ibes.org/cgi/cm.exe?comm=1&seid=I0IG04FIIBKAIS34&tpl=200&mode=1&toenglish=*&mode=1", ¬
"http://dict.leo.org/?search=*", ¬
"http://europa.eu.int/eurodicautom/Controller?CURRENTSCREEN=EXPERT2&query=*&source=DE&target=EN&display_term=HITALL"}
on lookup(s)
-- encode search string
set searchString to encodeString(s)
-- set URL list
set searchURLs to {}
repeat with u in dictList
set searchQuery to searchURL(u, searchString)
set searchURLs to searchURLs & searchQuery
end repeat
openTabs(searchURLs)
end lookup
on openTabs(urlList)
tell application "OmniWeb"
activate
set b to (make new browser at beginning of browsers)
set firstTab to true
repeat with aURL in urlList
if firstTab then
set firstTab to false
set address of b to aURL
else
tell b to set t to (make new tab at end of tabs with properties {address:aURL})
end if
end repeat
end tell
end openTabs
on encodeString(this_URL)
set this_URL to this_URL as text
set otids to AppleScript's text item delimiters
set AppleScript's text item delimiters to {" "}
set tItems to every text item of this_URL
set AppleScript's text item delimiters to {"%20"}
set this_URL to tItems as text
set AppleScript's text item delimiters to otids
return this_URL
end encodeString
on searchURL(URLTemplate, searchTerm)
set character_list to (characters of URLTemplate)
set outputString to ""
repeat with this_char in character_list
if (this_char as string) is "*" then
set outputString to (outputString & searchTerm)
else
set outputString to (outputString & (this_char as string))
end if
end repeat
return outputString
end searchURL
Posted by: Michael at December 19, 2004 10:58 PM
Wow, thanks. I'll see if I can get this working.
Posted by: Heather at December 20, 2004 07:48 AM