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

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

by

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.

word count automator service 2
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.

How to Create a Word Count Service in Automator

  1. Launch Automator from the Applications folder.
    1 Automator

  2. Click New Document.

  3. Choose Service as the type of your document.
    2 Automator document type

  4. Type "run" into the Library search field at the top of the Automator sidebar, then drag the Run Shell Script action into the empty workflow area.
    automator drag shell script

  5. In the Run Shell Script action window, change the Pass Input: option to as arguments using the dropdown menu.
    automator run shell script

  6. Clear the text in the shell script box (highlight the text with your mouse cursor and hit Backspace) then copy and paste the following text into the same area:

    echo Words:

    echo $1 | wc -w

    echo Characters including spaces:

    echo $1 | wc -c
    automator word count script

  7. Clear the Library search field at the top of the Automator sidebar and type "set value", then drag the Set Value of Variable action into the workflow area.
    automator set value of variable

  8. Click the Variable: dropdown menu and select New Variable....

  9. In the blue dialog that appears, click inside the Name: input field. It may default to "storage", but you can rename it – we'll call it "count". Click Done, and you should now see "count" (or whichever name you used) appear in the variable list below the workflow area.
    automator variable name

  10. Clear the Library search field at the top of the Automator sidebar again, and this time type "ask", then drag the Ask for Confirmation action into the workflow area.
    drag ask for confirm

  11. Now, drag your "count" variable from the variable list up to the "Message" title in the Ask for Confirmation action.
    drag count variable

  12. In the Automator menu bar, select File -> Save..., call your new service "Word Count", and click Save.

Next time you want to get a word count and/or character count for some text you've highlighted, simply right-click (or Ctrl-click) on the text and select Services -> Word Count from the contextual dropdown menu.

word count
You can assign a key shortcut to it for even faster access. To do so, launch System Preferences, select the Keyboard pane, and click the Shortcuts tab. Select Services from the sidebar and you should find Word Count near the bottom of the list. Just click it, select Add Shortcut, and finally, enter your custom key combination.

word count shortcut

Top Rated Comments

110 months ago
Srsly guys... I don't think I'll need this. But you rock! Keep these guides and tutorials coming!!! They are MUCH appreciated!
Score: 11 Votes (Like | Disagree)
110 months ago
Srsly guys... I don't think I'll need this. But you rock! Keep these guides and tutorials coming!!! They are MUCH appreciated!
Was gonna say exactly this till I saw your post. Reminds me of MacOXSHints.
[doublepost=1526030048][/doublepost]
Or get WordService for free from the App Store to give you text stats and so much more:
https://itunes.apple.com/app/wordservice/id899972312?mt=12
Maybe but this also teaches you stuff.
Score: 6 Votes (Like | Disagree)
fairuz Avatar
110 months ago
Automator is one of the many amazing productivity features in macOS that few know about. It's saved me so much time.
Score: 2 Votes (Like | Disagree)
IJ Reilly Avatar
110 months ago
Or get WordService for free from the App Store to give you text stats and so much more:
https://itunes.apple.com/app/wordservice/id899972312?mt=12
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
[doublepost=1526061714][/doublepost]
Maybe but this also teaches you stuff.
I learned that I don't have to do it myself. ;)
Score: 2 Votes (Like | Disagree)
99 months ago
Has anyone actually checked how exact this is? I'm testing it now and the "characters including spaces" count seems to always be one more than it should be, regardless of the text or the program that I'm using the action in (e.g. safari, textedit, etc). Can anyone confirm if it's working 100% properly or not on their mac?

I know it's not a 'huge deal', and I can just manually deduct 1 myself, but it'd be interesting to know if anyone else is experiencing this and if so, if there's a way to get it exact. The exact character count is what I'm using this function for, because I use sites which limit titles & descriptions to exact character counts; and some sites, for some reason, don't actually tell you how many characters you've entered, just that you've "exceeded the maximum number of characters".

Thanks
Score: 1 Votes (Like | Disagree)
ArtOfWarfare Avatar
110 months ago
There are definitely existing Sublime plugins for word count. I'm using this one ('https://github.com/titoBouzout/WordCount')and it's great.

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.
Score: 1 Votes (Like | Disagree)

Popular Stories

Apple Creator Studio iWork suite

Apple Pulls Keynote, Pages and Numbers From App Store [Update: Back]

Thursday October 22, 2026 11:01 am PDT by
Apple has temporarily removed Keynote, Pages, and Numbers from the App Store, just after releasing an update that added iPhone Duo support and a new Intelligent Assistant. It is not clear if the apps were removed intentionally, or if it is a bug. Apple has not said when the apps will be reinstated, but if it was in error, they should return soon. Update: The Mac versions are back without...
Apple Music iPod Page Not Found

Apple Music Has a Hidden iPod You Can Play With

Friday October 23, 2026 7:11 am PDT by
Apple Music has a 404 page easter egg on the web: a functional iPod that appears when you load a page that does not exist, such as music.apple.com/macrumors. "Page Not Found," says Apple. "Give this a spin instead." Apple is clever with this. If you navigate to music.apple.com/ipod instead, the page says "Looking for something?" instead of "Page Not Found." The easter egg is only...
iphone duo screen crack in store

Crackgate? iPhone Duo Owners Report Screens Breaking Along the Hinge

Friday October 23, 2026 11:05 am PDT by
Some iPhone Duos are already experiencing hinge issues that cause display cracks, based on photos shared on Reddit and the MacRumors forums. Almost all of the display faults are right along the hinge, and most result in a line of bright pixels across one side of the screen. An iPhone Duo owner in Australia said his device cracked after being opened fewer than 20 times, and there was no...
Latest Stories
Verizon Apologizes for iPhone Duo Pre-Order Delays, Giving Customers $100 Gift Card
Verizon Apologizes for iPhone Duo Pre-Order Delays, Giving Customers $100 Gift Card
2 hours ago
Skip the Touch ID Scan: Unlock iPhone Duo With Apple Watch
Skip the Touch ID Scan: Unlock iPhone Duo With Apple Watch
2 hours ago
iPhone Duo Fails JerryRigEverything's Dusty Durability Test
iPhone Duo Fails JerryRigEverything's Dusty Durability Test
2 hours ago
Make iPhone Duo Volume Buttons Follow Screen Rotation
Make iPhone Duo Volume Buttons Follow Screen Rotation
4 hours ago
iPhone Duo Teardowns Reveal Two Batteries and More
iPhone Duo Teardowns Reveal Two Batteries and More
5 hours ago
M5 MacBook Air Returns to Prime Day Low With $200 Amazon Discount
M5 MacBook Air Returns to Prime Day Low With $200 Amazon Discount
6 hours ago
Top Stories: Apple 'Pro and Tell' Debut, iPhone Duo Launch, and More
Top Stories: Apple 'Pro and Tell' Debut, iPhone Duo Launch, and More
8 hours ago
Apple Store Pickup System for iPhone Duo Just Went Live Again in U.S. and Canada
Apple Store Pickup System for iPhone Duo Just Went Live Again in U.S. and Canada
8 hours ago
Apple Closes French Stores Ahead of Further Protests
Apple Closes French Stores Ahead of Further Protests
16 hours ago
Apple Pushes Back on DOJ Request for More Evidence
Apple Pushes Back on DOJ Request for More Evidence
16 hours ago
The iPhone Duo Can Be a Tiny Mac, a Toaster, and a Nintendo DS
The iPhone Duo Can Be a Tiny Mac, a Toaster, and a Nintendo DS
21 hours ago
Using an Apple Pencil With the iPhone Duo: What to Know
Using an Apple Pencil With the iPhone Duo: What to Know
1 day ago
Apple Store Pickup for iPhone Duo Starting to Resume But Very Limited
Apple Store Pickup for iPhone Duo Starting to Resume But Very Limited
1 day ago
iPhone Duo Jailbroken on Launch Day
iPhone Duo Jailbroken on Launch Day
1 day ago
Apple Seeds Updated watchOS 27.2 Release Candidate
Apple Seeds Updated watchOS 27.2 Release Candidate
1 day ago
Apple Store in UK Reopens With New Design on iPhone Duo Launch Day
Apple Store in UK Reopens With New Design on iPhone Duo Launch Day
1 day ago
Crackgate? iPhone Duo Owners Report Screens Breaking Along the Hinge
Crackgate? iPhone Duo Owners Report Screens Breaking Along the Hinge
1 day ago
iPhone Duo Brings Back Long Lines at Apple Stores
iPhone Duo Brings Back Long Lines at Apple Stores
1 day ago
The MacRumors Show: iPhone Duo Arrives, Touchscreen MacBooks Next
The MacRumors Show: iPhone Duo Arrives, Touchscreen MacBooks Next
1 day ago
Apple Released iOS 27.1 for iPhone Duo Only
Apple Released iOS 27.1 for iPhone Duo Only
1 day ago
iPhone Duo: Open Two Apps Side by Side and Lock Them As an App Pair
iPhone Duo: Open Two Apps Side by Side and Lock Them As an App Pair
1 day ago
iPhone Duo Launches With Carrier and Accessory Discounts Available
iPhone Duo Launches With Carrier and Accessory Discounts Available
1 day ago
Apple Music Has a Hidden iPod You Can Play With
Apple Music Has a Hidden iPod You Can Play With
1 day ago
iPhone Duo Says 'Hello' to You Personally
iPhone Duo Says 'Hello' to You Personally
1 day ago
iPhone Duo: How to Skip the Swipe Up After Touch ID
iPhone Duo: How to Skip the Swipe Up After Touch ID
1 day ago
Where to Buy iPhone Duo Today: Stores, Pickup, and Wait Times
Where to Buy iPhone Duo Today: Stores, Pickup, and Wait Times
1 day ago
MacBook Neo Helps Apple Outpace Rivals as Market Declines
MacBook Neo Helps Apple Outpace Rivals as Market Declines
2 days ago
Happy 25th Anniversary, iPod
Happy 25th Anniversary, iPod
2 days ago
iPhone Duo Demand Reportedly Exceeds Apple's Expectations
iPhone Duo Demand Reportedly Exceeds Apple's Expectations
2 days ago
iPhone Duo Launch Begins as First Orders Reach Customers
iPhone Duo Launch Begins as First Orders Reach Customers
2 days ago