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

    MacRumors

    Joined:
    Apr 12, 2001
    #1
    [​IMG]


    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.

    [​IMG]

    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 read more...

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

    MacHiavelli

    Joined:
    May 17, 2007
    Location:
    new york
    #2
  3. TheralSadurns macrumors 6502a

    Joined:
    Jul 8, 2010
    #3
    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

    Joined:
    Nov 4, 2008
    #4
    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

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

    Joined:
    Oct 19, 2007
    Location:
    uk
  7. jmh600cbr macrumors 6502a

    jmh600cbr

    Joined:
    Feb 14, 2012
    #7
    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

    cgriffis753

    Joined:
    Oct 12, 2010
    Location:
    Michigan
    #8
    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

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #9
    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

    Joined:
    May 11, 2018
    #10
    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

    KazKam

    Joined:
    Oct 25, 2011
    #11
    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

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

    Joined:
    Aug 20, 2015
    #13
    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

    Joined:
    Jun 11, 2010
  15. IJ Reilly macrumors P6

    IJ Reilly

    Joined:
    Jul 16, 2002
    Location:
    Palookaville
    #15
    Beat me to it. I've used this indispensable collection of services for over 15 years. Can also be downloaded here:

    https://www.macupdate.com/app/mac/10523/wordservice
    --- Post Merged, May 11, 2018 ---
    I learned that I don't have to do it myself. ;)
     
  16. Wanted797 macrumors 6502

    Wanted797

    Joined:
    Oct 28, 2011
    Location:
    Australia
    #16
    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

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

    Cheers!
     
  18. fairuz macrumors 65816

    fairuz

    Joined:
    Aug 27, 2017
    Location:
    San Francisco, USA
    #18
    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

    Joined:
    Feb 23, 2017
    #19
    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

    Jynto

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

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #21
    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

    Joined:
    Aug 20, 2015
    #22
    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