NanoCount is a little utility for MacOS X. It provides a word count feature for TextEdit, OS X's built-in word processor.
NanoCount is free, and the souce code is included in the download archive.
Or download the older, non-Intel version here:
(I am not the owner - I use it).