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

109 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)
109 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
109 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
109 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)
98 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
109 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

iphone 18 pro max prepare

iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping

Friday September 18, 2026 4:27 pm PDT by
The iPhone 18 Pro Max has a battery capacity over 20 watt-hours, which means there are additional shipping requirements. If an iPhone 18 Pro Max needs to be shipped somewhere, its maximum battery capacity has to be limited through firmware. According to Apple, the iPhone 18 Pro Max uses an "innovative battery-firmware solution" that limits battery capacity to below 20Wh between when the...
8 CarPlay Features in iOS 27 Feature

Which iOS 27 CarPlay Features Actually Work in Your Car?

Thursday September 17, 2026 4:17 am PDT by
In iOS 27, available now, CarPlay gets its biggest update in years, but some features depend on what type of car you have rather than your iPhone model. Some of the biggest additions won't do anything in the vast majority of vehicles on the road today. Here's how the new features pan out. Works in Any CarPlay Vehicle Custom widgets: In iOS 27, CarPlay is no longer limited to Apple's handful ...
imac video apple feature

Apple Releasing Two New Macs Next Week

Friday September 18, 2026 10:07 am PDT by
Last month, Apple announced new Mac mini and Mac Studio models, and the computers are finally set to launch this coming Tuesday, September 22. The new Mac mini is available with M6 and M5 Pro chip options, while the new Mac Studio can be configured with M5 Max or M5 Ultra chips. To learn more, read our coverage:Apple Announces New Mac Mini With M6 and M5 Pro Chips and More Apple Unveils ...
Latest Stories
M6 Pro Chip Result on Geekbench is Likely Fake
M6 Pro Chip Result on Geekbench is Likely Fake
10 hours ago
Apple Watch Ultra 4 Sees First Discount After Launch, Now $779.99 on Amazon
Apple Watch Ultra 4 Sees First Discount After Launch, Now $779.99 on Amazon
13 hours ago
Top Stories: iOS 27 and macOS Golden Gate Out Now, Siri AI Waitlist, and More
Top Stories: iOS 27 and macOS Golden Gate Out Now, Siri AI Waitlist, and More
15 hours ago
Apple Exec Says 'Hold Us Accountable' on iPhone Duo Crease
Apple Exec Says 'Hold Us Accountable' on iPhone Duo Crease
23 hours ago
iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping
iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping
1 day ago
Hands-On With the Apple Watch Series 12
Hands-On With the Apple Watch Series 12
1 day ago
M5 Ultra and M6 Chip Benchmark Results Reveal Graphics Performance
M5 Ultra and M6 Chip Benchmark Results Reveal Graphics Performance
1 day ago
iPhone 18 Pro Max in U.S. Has Qualcomm's Snapdragon X80 Modem
iPhone 18 Pro Max in U.S. Has Qualcomm's Snapdragon X80 Modem
1 day ago
Apple Releases Xcode 27.1 Beta With iPhone Duo Support
Apple Releases Xcode 27.1 Beta With iPhone Duo Support
1 day ago
Apple Watch Series 12 vs. Ultra 4 Buyer's Guide
Apple Watch Series 12 vs. Ultra 4 Buyer's Guide
1 day ago
MacRumors Giveaway: Win an iPhone Duo From iMazing
MacRumors Giveaway: Win an iPhone Duo From iMazing
1 day ago
'Shop Different': Apple Retail Pioneer Ron Johnson Shares the Inside Story
'Shop Different': Apple Retail Pioneer Ron Johnson Shares the Inside Story
1 day ago
Apple Teams Up With ROSÉ for iPhone 18 Pro Camera Ad
Apple Teams Up With ROSÉ for iPhone 18 Pro Camera Ad
1 day ago
The MacRumors Show: Is the iPhone Duo Actually Worth It?
The MacRumors Show: Is the iPhone Duo Actually Worth It?
1 day ago
Apple Designers Explain the Thinking Behind iPhone Duo
Apple Designers Explain the Thinking Behind iPhone Duo
2 days ago
Are iPhone 17 Pro Cases Compatible With iPhone 18 Pro? Here's What Apple Says
Are iPhone 17 Pro Cases Compatible With iPhone 18 Pro? Here's What Apple Says
2 days ago
Apple Supplier Subsidiary Considering U.S. Flash Memory Factory
Apple Supplier Subsidiary Considering U.S. Flash Memory Factory
2 days ago
Apple Launch Day Deals on iPhone 18 Pro, AirPods 5, Apple Watch Series 12, and More
Apple Launch Day Deals on iPhone 18 Pro, AirPods 5, Apple Watch Series 12, and More
2 days ago
iPhone 18 Pro Teardown Reveals How Apple Shrunk the Dynamic Island
iPhone 18 Pro Teardown Reveals How Apple Shrunk the Dynamic Island
2 days ago
iPhone 18 Pro Demand Stronger Than Expected
iPhone 18 Pro Demand Stronger Than Expected
2 days ago
Fan Site Lets You 'Design the Next iPhone'
Fan Site Lets You 'Design the Next iPhone'
2 days ago
Apple Stores Have a New 'Hello' Easter Egg, Here's Why
Apple Stores Have a New 'Hello' Easter Egg, Here's Why
2 days ago
iPhone 18 Pro: The New Features You Should Try First
iPhone 18 Pro: The New Features You Should Try First
2 days ago
iPhone 18 Pro: Using the New Variable Aperture Lens
iPhone 18 Pro: Using the New Variable Aperture Lens
2 days ago
Forgot to Pre-Order iPhone 18 Pro? Apple Store Pickup Available Today at Most Locations
Forgot to Pre-Order iPhone 18 Pro? Apple Store Pickup Available Today at Most Locations
2 days ago
Apple CEO John Ternus Teases iPhone 18 Pro Launch Day
Apple CEO John Ternus Teases iPhone 18 Pro Launch Day
2 days ago
First iPhone 18 Pro, Apple Watch Series 12, Apple Watch Ultra 4 and AirPods 5 Orders Arriving to Customers
First iPhone 18 Pro, Apple Watch Series 12, Apple Watch Ultra 4 and AirPods 5 Orders Arriving to Customers
2 days ago
iPhone 18 Pro Launching Tomorrow With These 10 New Features
iPhone 18 Pro Launching Tomorrow With These 10 New Features
2 days ago
How to Get the New 3-Month Trial of Apple One Premier ($120 Value)
How to Get the New 3-Month Trial of Apple One Premier ($120 Value)
2 days ago
New iPhone 18 Pro Models Will Have Day One Update
New iPhone 18 Pro Models Will Have Day One Update
2 days ago