I usually use TextEdit for writing my NaNoWriMo novel. There's no easy way to get a word count from an RTF file without exporting it as plain text and running "wc -w" on it. And, it was an excuse to learn some AppleScript.

So, I wrote the following little script to count the words in the front-most TextEdit window. Yay geekery!

on run
    set number_of_words to 0
    tell application "TextEdit"
        set number_of_words to count of words in text of document of front window
    end tell
    display dialog "The number of words is: " & number_of_words
    return the number_of_words
end run

(C) 2014 Laura Beegle · laura at beegle dot org · google+ · twitter · facebook

Built with Poole · Using jQuery and Bootstrap