Get the Word Count of a TextEdit Document in Growl
Whether it be for MacMembrane or word-smithing that I actually get paid for, I do almost all of my writing in TextEdit. The beauty of TextEdit is its lightweight simplicity as well as the platform/application portability of plaintext files.
One useful feature common to most other writing apps is a word count calculator. Why Apple doesn’t include this simplest of features in their simplest writing app is a mystery to me (has anyone ever upgraded to Pages for word count alone?). But fortunately it’s easy enough to add word count to TextEdit via AppleScript and have it displayed by a Growl notification. Here’s how it looks and the script to make it happen:
The Script
tell application "GrowlHelperApp"
tell application "TextEdit"
activate
set wrdCnt to count words of document 1
end tell
set defaultNotification to "TextEdit Word Count:"
set myAllNotesList to {defaultNotification}
register as application defaultNotification all notifications myAllNotesList ¬
default notifications {defaultNotification} icon of application "TextEdit.app"
notify with name defaultNotification title ¬
defaultNotification description "Roughly " & wrdCnt ¬
application name defaultNotification
end tell
There isn’t anything really special here, but it’s a useful little script to have in your toolbox. Let me know if you see anyway the script can be improved or made more useful.
Download Growl, a free and unintrusive event notification application for your Mac.