Hi, Alex,

This script works like a charm. Thanks a million.

Take care and have a great day.
Jamie Pauls
jamiepa...@gmail.com



> On Mar 27, 2015, at 7:10 PM, Alex Hall <mehg...@icloud.com> wrote:
> 
> (* Keywords:
> $wordCount: the number of words in the currently open document in TextEdit
> $characterCount: the number of characters in the currently open TextEdit 
> document
> $name: the name of the currently open document
> *)
> 
> set template to "$wordCount words ($characterCount characters) in $name."
> set utilities to import("utilities.scpt")
> 
> set {wordCount, characterCount, documentName} to {0, 0, ""}
> 
> tell application "TextEdit"
>       set my wordCount to count (words of document 1)
>       set my characterCount to count (characters of document 1)
>       set my documentName to name of document 1
> end tell
> 
> set keywords to {{"$wordCount", wordCount}, {"$characterCount", 
> characterCount}, {"$name", documentName}}
> set template to str_replace(keywords, template) of utilities
> tell utilities to speak(template)
> 
> on import(filename)
>       set p to (path to me) as text
>       set oldDelimiters to text item delimiters of AppleScript
>       set AppleScript's text item delimiters to ":"
>       set scpt to load script file (((text items 1 through ((length of (text 
> items of p)) - 1) of p) & filename) as text)
>       set text item delimiters of AppleScript to oldDelimiters
>       return scpt
> end import
> 

-- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to macvisionaries+unsubscr...@googlegroups.com.
To post to this group, send email to macvisionaries@googlegroups.com.
Visit this group at http://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/d/optout.

Reply via email to