How to Set Up a System-Wide Word Count Service on Your Mac

Discussion in 'Mac Blog Discussion' started by MacRumors, May 11, 2018.

  1. MacRumors macrumors bot


    Apr 12, 2001

    In this article, we're going to show you how to create a system-wide service that enables you to get an immediate word count and character count in TextEdit, Safari, Mail, or indeed any app on your Mac that lets you highlight text. It offers a handy home-made solution if you often find yourself pasting into a blank Word or Pages document for no other reason than to find out how many words are in a text selection.


    The steps below will guide you through the process of creating your own word count service using the macOS Automator app. It's a simple procedure to follow and should only take five minutes, but if you'd rather use a third-party solution, then check out WordCounter, a free Mac menu bar utility from Onekerato.

    Click here to

    Article Link: How to Set Up a System-Wide Word Count Service on Your Mac
  2. MacHiavelli macrumors 65816


    May 17, 2007
    new york
  3. TheralSadurns macrumors 6502a

    Jul 8, 2010
    Srsly guys... I don't think I'll need this. But you rock! Keep these guides and tutorials coming!!! They are MUCH appreciated!
  4. H2SO4 macrumors 68040

    Nov 4, 2008
    Was gonna say exactly this till I saw your post. Reminds me of MacOXSHints.
    --- Post Merged, May 11, 2018 ---
    Maybe but this also teaches you stuff.
  5. mingravity macrumors member

    Sep 5, 2013
    absolutely !! very useful read
  6. thasan macrumors 6502a

    Oct 19, 2007
  7. jmh600cbr macrumors 6502a


    Feb 14, 2012
    Teach us how to write a script that checks the size of the trash and downloads folder and when it exceeds a certain size it empties
  8. cgriffis753 macrumors regular


    Oct 12, 2010
    Mine Just Keeps showing 0. what am I doing Wrong?

    Edit: I fixed it. for some reason the copy paste was breaking it. When I typed the script it worked fine
  9. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Interesting. Writing a service like this seems like it might be easier than writing a Sublime plugin which is what I normally do when I want to automate a common text related activity.

    Although sublime plugins are cross platform whereas services would only work on a Mac.
  10. stop-hammertime macrumors newbie

    May 11, 2018
    This seems like a terrible idea because I don't believe input into the shell script is sanitized. A malicious string, perhaps something like "lol ; evilcommand" could cause "evilcommand" to be executed, enough to recursively delete everything in your home directory.
  11. KazKam macrumors 6502


    Oct 25, 2011
    Interesting, but all the text and code editors I use these days already have word and character counters built-in. Also, as stop-hammertime mentioned, if terminal commands aren't filtered, this script could execute code with unintended, or even dire consequences.
  12. MauiPa macrumors regular

    Apr 18, 2018
    Padawan, perhaps it is the journey and not the destination.
  13. ignatius345 macrumors 65816

    Aug 20, 2015
    There are definitely existing Sublime plugins for word count. I'm using this one and it's great.

    iMac 2018-05-11 at 12.37.18 PM.png
  14. ravinder08 macrumors regular

    Jun 11, 2010
  15. IJ Reilly macrumors P6

    IJ Reilly

    Jul 16, 2002
    Beat me to it. I've used this indispensable collection of services for over 15 years. Can also be downloaded here:
    --- Post Merged, May 11, 2018 ---
    I learned that I don't have to do it myself. ;)
  16. Wanted797 macrumors 6502


    Oct 28, 2011
    Automater is a awesome app.

    I used to use it for photos. I’d shoot in raw so the photos wouldn’t be ready to view straight away.

    I built to quick conversion tool so that I could easily bulk convert a folder of raw files. Really handy to quickly view or if I want to give them to someone else.
  17. Manzanito macrumors regular

    Apr 9, 2010
    Gotta love all these useful articles macrumors is publishing lately. Keep up the good work!

  18. fairuz macrumors 65816


    Aug 27, 2017
    San Francisco, USA
    Automator is one of the many amazing productivity features in macOS that few know about. It's saved me so much time.
  19. lec0rsaire macrumors 6502a

    Feb 23, 2017
    Once again this is very useful. Automator and AppleScript are powerful tools. While both were really essential in the past, macOS has evolved to the point where many common tasks (renaming a batch of files, etc.) can now be done quicker through native apps and the OS itself. Even though Apple has neglected both in recent years, there are so many creative solutions that can be found to make life a little bit easier. This is one of the reasons why I consider macOS to be superior to Windows. Automator, AppleScript and the Terminal let users have much more control over one’s machine. It’s well worth the time required to master all of them.
  20. Jynto macrumors 6502


    Jan 16, 2012
    Nottingham, UK
    Thanks! This was a big reason why I didn't use TextEdit for my writing. Problem solved now!
  21. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Of course. There's plenty of plugins for Sublime for anything lots of people need to do.

    I was saying that, more generally, I write plugins for Sublime when I regularly need to do something with text in some specific way. As opposed to writing a MacOS service, where it'll only work on Macs.
  22. ignatius345 macrumors 65816

    Aug 20, 2015
    I would too, if I knew how to! I'm just a lowly writer who uses Sublime as a great writing environment. :)
    --- Post Merged, May 14, 2018 ---
    I gotta say, Pages is pretty great (and free) and has a live word count. Only big drawback is that it locks you into .pages file format.

Share This Page