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

macOS 27 next to MacBook Pro Running macOS 27

Apple Announces 'Full Disk Access' Changes on macOS Due to AI Agents

Friday October 2, 2026 12:59 pm PDT by
In a post on its developer news website today, Apple announced that it will be introducing "additional controls" for the "Full Disk Access" setting on macOS due to new risks posed by AI agents. This announcement comes amid the rise of always-on AI agents like Meta's Muse and OpenAI's Dots, which have prompted privacy concerns. "Some developers are using Full Disk Access in ways that could...
iPhone 18 Pro Max Glacier Camera

Apple Says iPhone 18 Pro Max Users With AT&T Cellular Issue Need to Have Device Replaced

Friday October 2, 2026 8:21 pm PDT by
Apple today confirmed that a "small number" of iPhone 18 Pro Max users on the AT&T network have experienced an issue that causes the device to lose cellular service, thereby preventing phone calls, text messages, and data from working. Thousands of users complained about the issue across the Apple Support Community and other platforms. Apple said it released iOS 27.0.1 earlier this week and...
iPhone 18 Pro Max ATT

AT&T Acknowledges iPhone 18 Pro Max Issues: Update 'Immediately'

Thursday October 1, 2026 8:42 pm PDT by
In a text message sent to customers today, AT&T acknowledged that some iPhone 18 Pro Max devices on its network are experiencing cellular issues. AT&T said that customers should immediately update to iOS 27.0.1, despite the fact that many affected users have said that the update does not resolve the issues. There are now at least thousands of users that have experienced this problem,...
Latest Stories
iPhone Duo Makes Focus Modes Easier to Toggle From the Lock Screen
iPhone Duo Makes Focus Modes Easier to Toggle From the Lock Screen
12 minutes ago
EU iPhone and iPad Users Could Still Face Months-Long Wait for Siri AI
EU iPhone and iPad Users Could Still Face Months-Long Wait for Siri AI
39 minutes ago
Today Marks the 15th Anniversary of Steve Jobs' Death
Today Marks the 15th Anniversary of Steve Jobs' Death
1 hour ago
iPhone 18 Pro's Triple Live Activity Support Comes With a Catch
iPhone 18 Pro's Triple Live Activity Support Comes With a Catch
2 hours ago
Apple's New CEO John Ternus is Making Product Design a 'Major Priority'
Apple's New CEO John Ternus is Making Product Design a 'Major Priority'
8 hours ago
Apple Hiring 'iCup' Specialist
Apple Hiring 'iCup' Specialist
8 hours ago
MacBook Pro With OLED Display Rumored to Be 'Significantly Lighter'
MacBook Pro With OLED Display Rumored to Be 'Significantly Lighter'
9 hours ago
Apple Event Reportedly Planned for October 13
Apple Event Reportedly Planned for October 13
10 hours ago
Amazon Launches Early Prime Day Discounts on AirPods, iPad, MacBook Air, and More
Amazon Launches Early Prime Day Discounts on AirPods, iPad, MacBook Air, and More
18 hours ago
AirPods Pro 3 Hit Record Low $179 Price During Early Prime Day Sale
AirPods Pro 3 Hit Record Low $179 Price During Early Prime Day Sale
19 hours ago
Top Stories: Apple Smart Home Launch on October 13, iPhone Duo Production Issues, and More
Top Stories: Apple Smart Home Launch on October 13, iPhone Duo Production Issues, and More
2 days ago
Apple Says iPhone 18 Pro Max Users With AT&T Cellular Issue Need to Have Device Replaced
Apple Says iPhone 18 Pro Max Users With AT&T Cellular Issue Need to Have Device Replaced
2 days ago
Apple Announces 'Full Disk Access' Changes on macOS Due to AI Agents
Apple Announces 'Full Disk Access' Changes on macOS Due to AI Agents
3 days ago
AT&T and Apple Just Took Steps Toward Fixing iPhone 18 Pro Max Issue
AT&T and Apple Just Took Steps Toward Fixing iPhone 18 Pro Max Issue
3 days ago
AT&T on iPhone 18 Pro Max Issues: 'We Are Working With Apple'
AT&T on iPhone 18 Pro Max Issues: 'We Are Working With Apple'
3 days ago
Upgrading From an Older Apple Watch? Here's How the New Features Stack Up
Upgrading From an Older Apple Watch? Here's How the New Features Stack Up
3 days ago
Beats 360 Cushion Kits and Apple Accessories See Early Prime Day Price Drops
Beats 360 Cushion Kits and Apple Accessories See Early Prime Day Price Drops
3 days ago
Apple Store in UK Reopening on iPhone Duo Launch Day
Apple Store in UK Reopening on iPhone Duo Launch Day
3 days ago
AT&T Acknowledges iPhone 18 Pro Max Issues: Update 'Immediately'
AT&T Acknowledges iPhone 18 Pro Max Issues: Update 'Immediately'
3 days ago
New 'AirFly Drive' Accessory Turns Wired CarPlay Into Wireless CarPlay
New 'AirFly Drive' Accessory Turns Wired CarPlay Into Wireless CarPlay
4 days ago
Apple Shares Photos Shot on iPhone Duo
Apple Shares Photos Shot on iPhone Duo
4 days ago
Apple Says iPhone Duo Has Replaceable 'Cover Layer'
Apple Says iPhone Duo Has Replaceable 'Cover Layer'
4 days ago
Apple's Smart Home Camera Will Apparently Have 'No Video Recording'
Apple's Smart Home Camera Will Apparently Have 'No Video Recording'
4 days ago
Apple TV Just Updated Its Selection of 'Bonus' Movies
Apple TV Just Updated Its Selection of 'Bonus' Movies
4 days ago
iPhone 18 Pro Colors Buyer's Guide: Which Should You Choose?
iPhone 18 Pro Colors Buyer's Guide: Which Should You Choose?
4 days ago
Early Prime Big Deal Days: Best Discounts on Accessories, TVs, and More at Amazon
Early Prime Big Deal Days: Best Discounts on Accessories, TVs, and More at Amazon
4 days ago
MacBook Pro With OLED Touch Screen Rumored to Launch in October or November
MacBook Pro With OLED Touch Screen Rumored to Launch in October or November
4 days ago
Apple's All-New Home Hub Rumored to Launch in These Four Colors
Apple's All-New Home Hub Rumored to Launch in These Four Colors
4 days ago
iPhone 18 Pro Aperture Control Goes Fully Manual in Halide 3.2
iPhone 18 Pro Aperture Control Goes Fully Manual in Halide 3.2
4 days ago
Apple Stores Receive 'Do Not Open' Boxes Ahead of Smart Home Products Launch
Apple Stores Receive 'Do Not Open' Boxes Ahead of Smart Home Products Launch
4 days ago