Jul 31, '07 07:30:05AM • Contributed by: macevangelist
-- count all characters
count (the clipboard)
-- count all the words
count words of (the clipboard)
--count the paragraphs
count paragraphs of (the clipboard)
Press the Run button to execute the code you have written. The result will be displayed in the lower half of the window. If you want to check some other text, copy it to the clipboard and simply press the Run button again.
[robg adds: I took this one step further, and wrote a simple application that will display a dialog with the results. Here's the code:
set myCount to count (the clipboard)
set myWords to count words of (the clipboard)
set myParas to count paragraphs of (the clipboard)
display dialog "Characters: " & myCount & "
Words: " & myWords & "
Paragraphs: " & myParas
Note that there are line breaks entered after the & " at the end of two of the lines; those are there to make the dialog box easier to read. Save the code as a program, and you're set. To use the program, copy some text to the clipboard then launch the program. A dialog box will appear showing the counts for characters, words, and paragraphs. I'm sure there are more elegant ways to do this; I'm a total AppleScript novice.]
