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

iphone 17 pro max battery 1 year

Three Years of 80% Charge Limits on iPhone: The Results

Tuesday October 6, 2026 12:59 pm PDT by
Since 2023, Apple's newer iPhones have had an 80 percent charge limit for those who want to extend battery lifespan. Charging to 80 percent instead of 100 percent is supposed to put less stress on the battery, improving longevity. For the last three years, I've used that setting on my iPhone. I started with the iPhone 15 Pro Max, then did the iPhone 16 Pro Max, and most recently, the iPhone...
apple welcome home event

Apple Product Launch Announced for October 13: 'Welcome Home'

Thursday October 8, 2026 9:04 am PDT by
Apple today announced an upcoming product launch that will take place on Tuesday, October 13. We are expecting Apple's announcement to focus on new smart home products, including the long-rumored smart home hub, a new Apple TV 4K, and a refreshed HomePod mini. Subscribe to the MacRumors YouTube channel for more videos. The home hub is an all-new device that's like a cross between an iPad and...
MacBook Pro Ultra Feature 1

Apple to Launch Touchscreen OLED MacBook Pro and OLED iPad mini on October 27

Thursday October 8, 2026 1:31 pm PDT by
Apple will introduce new OLED touchscreen MacBook Pro models and an OLED iPad mini "on or around" Tuesday, October 27, reports Bloomberg. The launch will also include an M6 14-inch MacBook Pro and an M6 iMac. The October 27 follows Apple's October 13 debut of a new smart home hub, a revamped Apple TV 4K, and a refreshed HomePod mini. Earlier this month, MacRumors reported that Apple would do ...
Latest Stories
Accessory Deals This Weekend: Save on TVs, Headphones, and Smart Home Gear
Accessory Deals This Weekend: Save on TVs, Headphones, and Smart Home Gear
3 minutes ago
A New Apple TV 4K is Finally Coming on Tuesday
A New Apple TV 4K is Finally Coming on Tuesday
18 minutes ago
Top Stories: Apple's 'Welcome Home' Launch on October 13 and More
Top Stories: Apple's 'Welcome Home' Launch on October 13 and More
1 hour ago
Apple Stores Will Add Your Name to iPhone Duo's Startup Screen
Apple Stores Will Add Your Name to iPhone Duo's Startup Screen
15 hours ago
SpaceX Inches Closer to Becoming a U.S. Carrier
SpaceX Inches Closer to Becoming a U.S. Carrier
15 hours ago
Apple Potentially Behind 'HomeView' Trademark Filed Alongside 'homeOS' Last Year
Apple Potentially Behind 'HomeView' Trademark Filed Alongside 'homeOS' Last Year
17 hours ago
Mark Your Calendar: Six Important Apple Dates Coming Up This Month
Mark Your Calendar: Six Important Apple Dates Coming Up This Month
18 hours ago
MacRumors Giveaway: Win an Apple Watch Series 12 and a Nylon Band From Southern Straps
MacRumors Giveaway: Win an Apple Watch Series 12 and a Nylon Band From Southern Straps
21 hours ago
First Apple TV 4K Now 'Vintage' Ahead of New Model Coming on Tuesday
First Apple TV 4K Now 'Vintage' Ahead of New Model Coming on Tuesday
22 hours ago
The MacRumors Show: Apple's Smart Home Products Are Coming
The MacRumors Show: Apple's Smart Home Products Are Coming
22 hours ago
Apple Shares Fall After News of iPhone 18 Pro Order Cuts
Apple Shares Fall After News of iPhone 18 Pro Order Cuts
22 hours ago
Leak Details iPhone Features for Apple's LG Home Accessories
Leak Details iPhone Features for Apple's LG Home Accessories
23 hours ago
Prime Day Leftover Deals: AirPods Max 2 for $429, Mac Mini for $779.99, and More
Prime Day Leftover Deals: AirPods Max 2 for $429, Mac Mini for $779.99, and More
23 hours ago
Every M5 MacBook Air Now $200 Off on Amazon
Every M5 MacBook Air Now $200 Off on Amazon
1 day ago
Mac Shipments Fall, But Apple Still Gains Ground in Shrinking Market
Mac Shipments Fall, But Apple Still Gains Ground in Shrinking Market
1 day ago
Apple Reportedly Cuts iPhone 18 Pro Orders After Price Hike Dampens Demand
Apple Reportedly Cuts iPhone 18 Pro Orders After Price Hike Dampens Demand
1 day ago
Apple Signs Hiring and Licensing Deal With AI Podcast Startup Huxe
Apple Signs Hiring and Licensing Deal With AI Podcast Startup Huxe
1 day ago
Apple's October 13 Launch: What's Coming
Apple's October 13 Launch: What's Coming
2 days ago
Anthropic Says Users Can't Be Needlessly Cruel to Claude
Anthropic Says Users Can't Be Needlessly Cruel to Claude
2 days ago
Apple to Launch Touchscreen OLED MacBook Pro and OLED iPad mini on October 27
Apple to Launch Touchscreen OLED MacBook Pro and OLED iPad mini on October 27
2 days ago
Apple Now Pushing iPhone Users Still on iOS 26 to Install iOS 27
Apple Now Pushing iPhone Users Still on iOS 26 to Install iOS 27
2 days ago
Apple Has a New M&A Chief as Ternus Reshuffles Leadership
Apple Has a New M&A Chief as Ternus Reshuffles Leadership
2 days ago
Prepare for Apple's New Home Hub With These HomeKit Accessory Deals
Prepare for Apple's New Home Hub With These HomeKit Accessory Deals
2 days ago
Tim Cook Says He's 'Not Meddling' With Apple's New CEO John Ternus
Tim Cook Says He's 'Not Meddling' With Apple's New CEO John Ternus
2 days ago
Tim Cook Explains Why He Stepped Down as Apple CEO Before iPhone Duo Launch
Tim Cook Explains Why He Stepped Down as Apple CEO Before iPhone Duo Launch
2 days ago
Apple Product Launch Announced for October 13: 'Welcome Home'
Apple Product Launch Announced for October 13: 'Welcome Home'
2 days ago
Amazon Unveils New iPad Rivals With Alexa+ and Google Play
Amazon Unveils New iPad Rivals With Alexa+ and Google Play
2 days ago
Missed Prime Day? You Can Still Score Big on Apple Devices Today
Missed Prime Day? You Can Still Score Big on Apple Devices Today
2 days ago
Apple's Cheapest 16-Inch MacBook Pro Just Got a Massive $563 Discount on Amazon
Apple's Cheapest 16-Inch MacBook Pro Just Got a Massive $563 Discount on Amazon
2 days ago
Apple Still Expected to Announce Three New Products on October 13
Apple Still Expected to Announce Three New Products on October 13
2 days ago