The script can be reduced in code for general usage and without comments it is only a few lines.
The advantages of using a script:
- The output format can be customized.
- It can be written to output the statistic either to a message box, a new file, to output window, or even into the file itself.
- The statistic output can be produced also for the entire file, or only selected text, or for selected text and entire file.
- The word delimiters can be customized and it is possible to filter the word list before counting, for example to ignore strings with a single character like a or I.
Summarized, using a script gives a user with good skills in writing scripts the possibility to customize the statistic output to personal needs. If such a customization is not required or a user has no skills in writing scripts, calling the word count tool is definitely the better solution.