Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] a clip for word count of a string

Expand Messages
  • loro
    ... I don t think there is a built-in way to count words and the only way to get it from the menu command would be to have the clip actually run it and then
    Message 1 of 2 , Mar 22, 2010
    • 0 Attachment
      forkinpm wrote:
      >Hallo!
      >In NoteTabPro the text statistics dialog offers the ability to count
      >the number of words in a text string, using mouseover and the text
      >statistics button.
      >
      >Is it feasible to use the same concept, write a clip and have the
      >number inserted in brackets following the string?
      >
      >Given that the string was a sentence, could a version of the same
      >clip be used to count the words in each of 10 sentences in an opened
      >file, adding the number of words in brackets following each sentence?

      I don't think there is a built-in way to count words and the only way
      to get it from the menu command would be to have the clip actually
      run it and then mimic keystrokes to select and copy the right number
      from the dialog box. Doable but a little wonky.

      One idea would be to count spaces instead and add 1. Something like
      so (run on selected text).

      ^!Set %words%=^$StrCount("^%space%";"^$GetSelection$";false;false)$
      ^!Inc %words%
      ^!Info ^%words%

      How to select each sentence would depend on how the text looks. Is it
      one sentence a line? A blank line between them? All run together?

      Lotta
    Your message has been successfully submitted and would be delivered to recipients shortly.