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

111 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)
111 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
111 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
111 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)
100 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
111 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 Health AI Study App Feature

Apple Just Released a New App

Monday November 16, 2026 9:43 am PST by
Apple today launched a new research study in the U.S. to explore the use of AI for health, and it has released a dedicated iPhone app for participants. In a press release, Apple said the study and app are "designed to advance the understanding of how people interact with conversational health AI tools." The Apple Health AI Study App contains a generative AI chatbot that participants can...
iphone duo yellow hand

Apple Adds Facial Unlock Option on iPhone Duo in iOS 27.3

Monday November 16, 2026 10:17 am PST by
Apple today added a new option for unlocking the iPhone Duo using the front-facing camera, giving device users multiple ways to access their content. The feature is available in the second iOS 27.3 beta. The option to unlock with facial recognition is only available on the Lock Screen, and authentication via Touch ID is still needed for Apple Pay purchases, adding passwords and logins, and...
bug security vulnerability issue fix larry

iPhone Users Targeted in Major Website Security Breach

Tuesday November 17, 2026 4:41 am PST by
Hackers used some of the world's most popular websites to distribute malware designed to steal cryptocurrency and exploit vulnerabilities in iPhones and iPads this week, according to a new security investigation. Reuters reports that websites associated with 178 organizations were affected by the attack on Monday, November 16, including the likes of Zoom, BBC, CNN, HSBC, Salesforce, and...
Latest Stories
Instagram Now Lets You Save Songs to Apple Music
Instagram Now Lets You Save Songs to Apple Music
7 hours ago
Apple Releases Safari Technology Preview 257 With Bug Fixes and Performance Improvements
Apple Releases Safari Technology Preview 257 With Bug Fixes and Performance Improvements
9 hours ago
HomeView 27.2.1 Update Fixes Siri Bugs
HomeView 27.2.1 Update Fixes Siri Bugs
12 hours ago
Apple Card Offers New Users Double Daily Cash for a Year
Apple Card Offers New Users Double Daily Cash for a Year
13 hours ago
Apple Releases 27.2.1 HomeView Software Update
Apple Releases 27.2.1 HomeView Software Update
14 hours ago
Amazon Offering $100 Off Nearly All M4 iPad Air Models
Amazon Offering $100 Off Nearly All M4 iPad Air Models
15 hours ago
Apple's Fall Creator Studio Updates Now Live
Apple's Fall Creator Studio Updates Now Live
15 hours ago
iPhone 20 Pro Rumored to Return to Titanium
iPhone 20 Pro Rumored to Return to Titanium
15 hours ago
Target's Early Black Friday Event Offers Savings on Apple, TVs, and Accessories
Target's Early Black Friday Event Offers Savings on Apple, TVs, and Accessories
17 hours ago
Apple Announces 2026 App Store Award Finalists
Apple Announces 2026 App Store Award Finalists
18 hours ago
iPhone Duo 2 Likely to Retain Touch ID as Face ID Remains Uncertain
iPhone Duo 2 Likely to Retain Touch ID as Face ID Remains Uncertain
18 hours ago
Apple Releases Siri Remote Firmware Update
Apple Releases Siri Remote Firmware Update
18 hours ago
Amazon Takes $850 Off 2026 16-Inch MacBook Pro With M5 Max Chip
Amazon Takes $850 Off 2026 16-Inch MacBook Pro With M5 Max Chip
19 hours ago
WhatsApp's iCloud Backup Alternative Rolls Out to Beta Users on iPhone
WhatsApp's iCloud Backup Alternative Rolls Out to Beta Users on iPhone
19 hours ago
MacPaw's Moonlock Cybersecurity App Launches for iPhone
MacPaw's Moonlock Cybersecurity App Launches for iPhone
19 hours ago
Apple Reportedly Developing Two Designs for 20th Anniversary iPhone
Apple Reportedly Developing Two Designs for 20th Anniversary iPhone
20 hours ago
Apple Rolls Out All-New Maps Experience Across India
Apple Rolls Out All-New Maps Experience Across India
20 hours ago
iPhone Air 2 Reportedly Sticks With Same Display
iPhone Air 2 Reportedly Sticks With Same Display
21 hours ago
iPhone 18 and iPhone Air 2 Display Production to Begin Soon Ahead of Expected March Launch
iPhone 18 and iPhone Air 2 Display Production to Begin Soon Ahead of Expected March Launch
21 hours ago
Aqara Debuts Six Matter Smart Lights That Work With Apple Home
Aqara Debuts Six Matter Smart Lights That Work With Apple Home
1 day ago
Disney+ and Hulu Will Fully Merge Into One App in December
Disney+ and Hulu Will Fully Merge Into One App in December
1 day ago
iFixit Says Apple's HomeView is Unnecessarily Hard to Repair
iFixit Says Apple's HomeView is Unnecessarily Hard to Repair
1 day ago
Final Cut Pro Now Includes MotionVFX for Creator Studio Users
Final Cut Pro Now Includes MotionVFX for Creator Studio Users
2 days ago
Apple Blames Internal Update for Outage, Says It Wasn't a Cyberattack
Apple Blames Internal Update for Outage, Says It Wasn't a Cyberattack
2 days ago
Nomad Launches Black Friday Sale With Up to 30% Off Apple Accessories
Nomad Launches Black Friday Sale With Up to 30% Off Apple Accessories
2 days ago
Google Wallet Available on iPhone, But Without Tap to Pay
Google Wallet Available on iPhone, But Without Tap to Pay
2 days ago
Apple Accounts, App Store and Apple Music Experiencing Issues
Apple Accounts, App Store and Apple Music Experiencing Issues
2 days ago
Apple Moves Ahead With Better Dual SIM Support for Apps
Apple Moves Ahead With Better Dual SIM Support for Apps
2 days ago
Former Apple Chairman Plans to Sell $32 Million in Apple Stock
Former Apple Chairman Plans to Sell $32 Million in Apple Stock
2 days ago
Apple Accused of Silencing iPhone Duo Supplier Over 'Crackgate' Issue
Apple Accused of Silencing iPhone Duo Supplier Over 'Crackgate' Issue
2 days ago