Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use AppleScript to count words and characters in text' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use AppleScript to count words and characters in text
Authored by: wallybear on Aug 01, '07 04:54:40AM

And replacing "document 1" with "front document", you'll get the statistics for the document you're currently working on:

tell application "TextEdit"
set ch to count characters of front document
set wd to count words of text of front document
set par to count paragraphs of text of front document
display dialog "Characters: " & ch & return & "Words: " & wd & return & "Paragraphs: " & par buttons "OK"
end tell



[ Reply to This | # ]
Use AppleScript to count words and characters in text
Authored by: wallybear on Aug 01, '07 04:58:43AM

Sorry to keep posting replies to myself, but I just noted you can slightly simplify the script removing the words "of text" from the script, as they are superfluous.



[ Reply to This | # ]