Counting Characters

Just recently I opened my RSS-Reader and found a post by Chris Bowler regarding counting characters and using a script to do it system wide. Just some weeks ago I had the same problem and searched a script, found nothing to useful and cobbled something together my self. Since I use Quicksilver to launch apps, I also wanted to use Quicksilver to do the character/word and paragraph counting.

Now I do not want to share my own script — it was not that great — but after reading the post by Chris Bowler, I improved it a bit to work just perfect with Quicksilver and completely without Automator.

activate
tell application "System Events" to keystroke "c" using command down
set theInput to (the clipboard)
set theInput to (theInput as text)
set myCount to count (theInput)
set myWords to count words of (theInput)
set myParas to count paragraphs of (theInput)
tell me
activate
display dialog "Characters: " & myCount & return & "Words: " & myWords & return & "Paragraphs: " & myParas buttons {"Thanks"} default button 1
end tell

Download the Count_Characters_v1.0.scpt

What the script does is: It copies the currently selected text into the clipboard and counts the characters, words and paragraphs which are than output in form of a short text message at the display.

I hope that script helps a some people, I would like to get some feedback.

Leave a Reply