-- set the speed factor in decimal values, greater than 1 to slow down -- between 0 and 1 to speed up -- default of 1 is around 3 characters per second -- 0.5 will be twice the speed (half the time to type) property speedFactor : 1 tell application "TextEdit" set fullText to (text of document 1) set paras to (paragraphs of fullText) set theColour to color of paragraph 1 of document 1 set theSize to size of paragraph 1 of document 1 set lastPara to 1 repeat with i from 1 to count of paras try set thisPara to (paragraph i of fullText) if (thisPara is not (ASCII character 10)) and (thisPara is not "") then set displayText to (paragraph i of fullText) if i is greater than 1 then set displayText to (displayText & (return as text) & (paragraph (lastPara) of fullText)) end if set the text of document 1 to displayText try set color of (paragraph 1 of document 1) to {65000, 3000, 3000} try set color of (paragraph 2 of document 1) to {35000, 35000, 35000} end try set size of (paragraph 1 of document 1) to 18 end try set theWords to words of (paragraph i of fullText) repeat with j from 1 to (count of theWords) set theWordChars to characters of (word j of paragraph i of fullText) set wordCharNum to count of theWordChars set silencePeriod to ((wordCharNum / 3) * speedFactor) set color of (word j of paragraph 1 of document 1) to {3000, 3000, 65000} if j is greater than 1 then set color of (word (j - 1) of paragraph 1 of document 1) to {65000, 3000, 3000} end if say (((word j of paragraph i of fullText) & "[[slnc " & (round (silencePeriod * 1000) rounding as taught in school) & "]]") as text) end repeat set lastPara to i else say "New Section" end if say "New paragraph" on error if (exists of document 1) is false then make new document at beginning of documents end if try set color of paragraph 1 of document 1 to theColour set size of paragraph 1 of document 1 to theSize set text of document 1 to fullText end try exit repeat end try end repeat end tell