« Poetry; it's fun! | Main | Hot Chocolate »

January 23, 2005

FrenchLookup: Cocoa Services
geekage, thing

"Three great virtues of programming are laziness, impatience, and hubris."
-Larry Wall

Being something of a francophile, I'll sometimes go surfing the web for french news or blogs or whatnot else to read, or try to tackle a bit of a text from Gutenburg. However, also being quite lazy, I certainly don't want to have to go to the trouble of looking up words that I don't know in an actual pulp-based bit of binding. Thankfully, there's a handy dandy online French dictionary, which has most words I need- the rest I can bear to lookup in the paperback. Even with this, however, it's a spot of an annoyance to copy 'n paste words into the dictionary's form.

So, I got the idea that I could automate the process. A contextual menu would have been best, but I don't know that such a global menu is possible in OSX. I then realized that, with a service doing the lookup on the selected word(s), I could have a global key command to bind to a mouse button!

Thanks to CocoaDev and a line or so of additional code it was soon working. Then, with some help from the handy dandy [NSString stringByAddingPercentEscapesUsingEncoding: NSISOLatin1StringEncoding] and some fixing of foolish but fun to solve problems, spread out over a few weeks, it no longer choked on accents and worked quite well. Yay for Cocoa! A few clicks about in the Logitech Con- eek. I think I'm out of buttons. I suppose I'd best cave in and get USB Overdrive (or maybe not- looks like it doesn't support nifty stuff like chording. cripes.).

While we're on the topic of services, if you have entries in your services menu from 5 different web browsers, 3 different text editors, and a myriad assortment of other programs, Service Manager is invaluable. It apparently just simply removes/modifies the services in the Info.plist files of the applications in question, but does so quite easily and quickly.

UPDATE: Another day, another browser. I realized that a two year old version of Firefox probably wasn't very representative of the browser, so I downloaded a new version. It's MUCH faster and prettier, and the selection of extensions is awesome. It's quite likely that DictionarySearch will become my new dictionary solution, and along with ForecastFox and the rest of Firefox's entourage, it's quite possible that Safari will be demoted to second in command.

Posted by Trevor Savage at January 23, 2005 3:16 PM

Comments

Post a comment




Remember Me?