Community
    • Login

    Word count in Status Bar on text selection

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 4 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Michelle PaceM
      Michelle Pace
      last edited by

      Hello,

      Question 1: Is there a way to select a paragraph and see the corresponding word count (and character count) in the status bar?

      Question 2: If there is no way to do Q1, then, is it possible to see a word count for all text in the tab in the status bar? (just like I see the char count)

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Michelle Pace
        last edited by

        @Michelle-Pace

        The direct answer to both questions is No.

        Although it isn’t constantly on-screen, one thing you can do to obtain some of the information (word count in the entire document) on-demand is to use the View menu’s View Summary feature.

        If you are willing to use a scripting plugin, then you can get closer to what you want, all around, but still on an on-demand basis.

        There’s a PythonScript HERE that, when run, will show you the number of words in your text selection and output it in a message box. To obtain a word count for the entire document, simply Select All (Ctrl+a) before running the script.

        If you are going to pursue the scripted solution, have a read HERE to learn about how to do scripting.

        Side note: In theory, the scripting plugin could update the status bar to provide fully what you want, but there is a long-standing bug in the plugin regarding selected text and screen updates; see HERE.

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA Alan Kilborn referenced this topic on
        • Mark OlsonM
          Mark Olson
          last edited by

          If you go to the bottom of this issue in the Notepad++ GitHub repo, you will find a script I wrote that does everything you’re asking for.

          1 Reply Last reply Reply Quote 2
          • guy038G
            guy038
            last edited by

            Hello, @michelle-pace,

            You may also be interested by this Python script, built up with the @alan-kilborn’s collaboration and some other Python gurus !

            On the last line of this Summary report, it will give you, at the same time, the number of characters, words and bytes of all your selected text, in one or several ranges, of the current file, whatever the view used !

            https://community.notepad-plus-plus.org/topic/20218/emulation-of-the-view-summary-feature-with-a-python-script/14

            Of course, if you select all the file contents, the results, reported in the last SELECTION(S) line, should be identical to the 3 lines just above :
            Total chars, Words count and Buffer length


            BTW, note, that I added the mention (Caution !) in the Words line, because the word notion is quite odd in many languages ! Refer to this post :

            https://community.notepad-plus-plus.org/topic/20218/emulation-of-the-view-summary-feature-with-a-python-script/3


            If needed, you may even change the default definition of a word character, as explained at the beginning of the post !

            Best Regards,

            guy038

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors