I needed a word count this morning, for all the text in the nodes of a diagram.
In case anyone else needs to do this, here is what I used:
Code:
-- Word Count for OmniGraffle
-- Ver .001
set text item delimiters to space
tell application id "com.omnigroup.OmniGrafflePro"
set oWin to front window
tell canvas of oWin
set lngWords to count of words of ((text of solids) as text)
set {strCanvas, strDoc} to {name, name of oWin}
end tell
display dialog (lngWords as string) & " words in" & return & return & strCanvas ¬
& " of " & return & return & strDoc buttons {"OK"} with title "OmniGraffle Word Count" with icon 1
end tell