Systemwide ‘Word Count’ Service for OS X

John Gruber explained how to set this up a year ago:

Back in October my friend Jesper wrote a nifty little utility called ThisService. You give ThisService a script — either AppleScript or any Unix scripting language such as Perl, Python, or Ruby — and it generates a system-wide service based on that script, right there in the Services menu, available in any app. No Xcode or Cocoa required. You just write the script… …This one is about as simple as it gets, but I use it quite often. It takes as input the currently selected text in the frontmost app, and then displays an alert showing the number of words in the selection.

I installed it and it works spectacularly well. This is particularly useful for applications that don’t have their own word counters (Safari), or for ones that have word counters with stupid keyboard shortcuts (TextMate).

Just one thing to note, finding the right keyboard shortcut proved somewhat difficult for me. The one Gruber uses, shift-command-K, will interfere with Safari’s “Block Pop-Up Windows” menu item (which I don’t think needs a friggin’ shortcut to begin with). I opted for shift-command-End, as that isn’t likely to conflict with any app’s built-in shortcuts.

Tags: ,

Leave a Reply