TextEdit is far leaner than other, bulkier text editors or word processors, but it is spartan enough not to have a word count feature. So I wrote one and I thought it might be useful to somebody else.
The following AppleScript adds a word (and character) count pop-up dialog to TextEdit:
tell application "TextEdit"
set word_count to count words of document 1
set char_count to count characters of document 1
set show_words to (word_count as string) & " words. (" & (char_count as string) & " characters.)"
set dialog_title to "TextEdit Word Count"
display dialog show_words with icon 1 with title dialog_title buttons {"Ok"} default button "Ok"
end tellTextEdit Word Count 2832 words. (15060 characters.)The 'OK' button dismisses the dialog box.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100504062201437