As part of my "write a blog entry every day during November" commitment, I considered imposing a minimum word limit for each entry. I've decided against that, because I don't want to feel pressure to add filler, but before deciding that, I created an Automator service that would help me to count words.
How to Use the Service
To use it, just select some text, hit Command-C to copy it to the clipboard, and then choose Speak Count of Words on Clipboard from the application's Services menu.
How to Create It
Here's how to create the service (using Mac OS X 10.6 Snow Leopard, of course):
- Start Automator, and choose "Service" as the workflow template.
- Choose "no input" and "any application" in the "Service receives . . ." section at the top.
- Drag a Get Contents of Clipboard action from the left column to the workflow pane.
- Drag a Run Shell Script action from the left column to the workflow pane, beneath the Get Contents of Clipboard action.
- In the Run Shell Script text area, replace "cat" with this:
echo "The selection contains `wc -w` words."
- Drag a Speak Text action from the left column into the workflow area, beneath the Run Shell Script action.
- Choose the File -> Save menu item, and save it as "Speak Count of Words on Clipboard".
Here's how it should look:
If you think you are going to use this a lot, go to the Services Preferences and assign a keyboard shortcut.