TextEdit is the word processor that has always accompanied the different versions of OS X and that is still present. It is the successor to SimpleText and best of all, it is free. That is, once you get a Mac computer you know that you will be able to work with texts from the first moment and without having to go through the license box or having to download any alternative opensource.
With TextEdit you can compose texts with ease. What's more, you can do it in HTML. On the other hand, TextEdit is capable of displaying documents in Word or OpenOffice format. However, if you really dedicate yourself to joining letters, surely you are missing a function that is available in other processors: the word counter. TextEdit lacks this source function. However, thanks to MacWorld let's create a script so you can carry out the task.
First thing: launch Automator. This one is in Finder> applications and you will have to search the long list. Once launched, it will ask you what type of document you want to create. We will select "Service". You will see that suddenly another window appears on the right side of Automator. There you should indicate that the service receives the "text" selection and that it will be used in the "TextEdit" application. (These steps are shown in the screenshots)
Next, on the left side of the screen, you will have to select "Library" and look for the option "Run the Shell script". Again a dialog box will open on the right side of the screen and here we must copy and paste (everything as it is) the following text:
osascript << - AppleScriptHereDoc
tell application "TextEdit"
set word_count to count words of document 1
set char_count to count characters of document 1
set show_words to (word_count as string) & »words. (»& (Char_count as string) &» characters.) »
set dialog_title to "TextEdit Word Count"
display dialog show_words with icon 1 with title dialog_title buttons {"Ok"} default button "Ok"
end tell
AppleScriptHereDoc
Once glued on the box, We will only have to go to the Automator menu bar and in "File" click on "Save". It will ask you to give the script a name. We have dubbed it "Word Counter". And voila, you have the operational function. For this to work you must always select the text and click on the right button of the mouse where the function will appear in the last menu option.
I did not get the word counter. It gives me an error: The action "Execute the shell script" has encountered an error: "17:18: syntax error: Expected key expression, property or form, etc. but unknown identifier found. (-2741) "
EXACTLY THE SAME happens to me too ...
osascript << - AppleScriptHereDoc
tell application "TextEdit"
set word_count to count words of document 1
set char_count to count characters of document 1
set show_words to (word_count as string) & "words. (" & (char_count as string) & "characters.)"
set dialog_title to "TextEdit Word Count"
display dialog show_words with icon 1 with title dialog_title buttons {"Ok"} default button "Ok"
end tell
AppleScriptHereDoc
You're very big! Thank you very much!
It doesn't work for me either ... too bad