I have been searching high and low for a TextEdit word count script and I found NanoCount that actually does I needed. However, I am used to using the right mouse button to find out the number of words in a text file. (You are right. I was a Windows user.)
Then I discovered Automator which comes with Mac OS X.
TextEdit Word Count: My First Automator Script
I have little programming background and I find the Automator extremely easy to learn. However, I am totally alien to AppleScript and so I decided to google around for similar scripts to use in Automator. Here’s the 2 web pages where I used part of the codes in my TextEdit WordCount script.
Automator Example: TextEdit WordCount Service
First, open Automator in the Applications folder. Select Services.
Click at the option box “any application” to display the pull-down menu. Select Finder
In the Application folder, choose TextEdit.
On the second column of the Automator window, search for the action “Run AppleScript” by entering “run applescript” in the search box.
Double click at “Run AppleScript” or drag and drop this action into the workflow area.
Copy and paste the following codes into the AppleScript widows:
set word_count to count words of (input as string)
display alert "Words: " & word_count
Then, compile the codes by clicking at the hammer icon.
Save the Automator Service.
Next, test out TextEdit Word Count service.
Open a text file using TextEdit, highlight the text which you want to word count. Click the right button on the mouse.