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

iOS 18 Siri Personal Context

Siri AI Settlement Website Now Live: Apple to Pay Some iPhone Owners

Sunday September 20, 2026 7:24 pm PDT by
In May, Apple agreed to pay $250 million to settle a U.S. class action lawsuit over Siri AI's delayed launch, and the settlement website is now live. Apple will pay an estimated $25 per eligible iPhone to eligible customers, who can submit a claim via the settlement website between September 21 and December 21 of this year. The exact payment may be higher or lower than $25 depending on the...
iOS 26 Home Feature

Apple Will Soon Announce an All-New Operating System

Tuesday September 22, 2026 9:19 am PDT by
Apple is developing an all-new operating system that is essentially a mix of tvOS, watchOS, and iOS, according to Bloomberg's Mark Gurman. In his latest Power On newsletter, Gurman reiterated that the operating system will feature a grid of app icons, widgets, and customizable clock faces. The new software platform is intended for Apple's long-rumored smart home hub. With built-in facial...
Mostly Screen iPhone Purple Feature 2027

iPhone 20 Pro Display Sizes Leak Ahead of 2027 Launch

Monday September 21, 2026 4:29 am PDT by
Apple's 20th-anniversary iPhone lineup could feature slightly larger displays than the iPhone 18 Pro models, if a new leak shared on Weibo is accurate. Prolific Chinese leaker Digital Chat Station claims that early iPhone 20 Pro display specifications include a 6.41-inch screen with a resolution of approximately 2,686 × 1,236 pixels, while the iPhone 20 Pro Max is said to have a 6.96-inch...
Latest Stories
ChatGPT in Siri 'Persistently Underperforming,' Says OpenAI
ChatGPT in Siri 'Persistently Underperforming,' Says OpenAI
5 hours ago
You Can Now Try Apple's Unreleased Copland OS in Your Browser
You Can Now Try Apple's Unreleased Copland OS in Your Browser
8 hours ago
iOS 27.0.1 is Coming Soon
iOS 27.0.1 is Coming Soon
9 hours ago
Apple Releases watchOS 27.0.1 With Fix for Restart Bug
Apple Releases watchOS 27.0.1 With Fix for Restart Bug
10 hours ago
Disney+ and Hulu Raise Prices Again, Ad-Free Plans Now $21.49
Disney+ and Hulu Raise Prices Again, Ad-Free Plans Now $21.49
10 hours ago
Apple Sports App Updated With Even More Soccer Leagues
Apple Sports App Updated With Even More Soccer Leagues
10 hours ago
AirTag 2 4-Pack Hits $79.99 on Amazon, Matching Record Low
AirTag 2 4-Pack Hits $79.99 on Amazon, Matching Record Low
12 hours ago
Siri AI Coming to HomePod
Siri AI Coming to HomePod
12 hours ago
iPhone Air vs. iPhone 18 Pro Buyer's Guide: Which Should You Buy?
iPhone Air vs. iPhone 18 Pro Buyer's Guide: Which Should You Buy?
13 hours ago
Apple Podcasts Subscriptions Will Soon Support Video
Apple Podcasts Subscriptions Will Soon Support Video
15 hours ago
Apple Watch Ultra 3 Drops to Record Low $599.97 on Amazon [Updated]
Apple Watch Ultra 3 Drops to Record Low $599.97 on Amazon [Updated]
15 hours ago
AT&T Responds to iOS 27's New iPhone Handoff Feature
AT&T Responds to iOS 27's New iPhone Handoff Feature
15 hours ago
Launch Discounts Arrive for New Mac Mini and Mac Studio, Plus Massive Deal on Samsung's Portable SSD
Launch Discounts Arrive for New Mac Mini and Mac Studio, Plus Massive Deal on Samsung's Portable SSD
15 hours ago
New iPhone Setting Lets Users Shake Off Motion-Sensing Ads
New iPhone Setting Lets Users Shake Off Motion-Sensing Ads
18 hours ago
Apple Intelligence Taking Up 30GB+ on Some Macs Running macOS 27
Apple Intelligence Taking Up 30GB+ on Some Macs Running macOS 27
19 hours ago
New Mac Mini Has Two Storage Downsides, Including Unremovable SSD
New Mac Mini Has Two Storage Downsides, Including Unremovable SSD
1 day ago
Apple Card Savings Account's Interest Rate Just Went Up
Apple Card Savings Account's Interest Rate Just Went Up
1 day ago
Apple Releases First Public Betas of iOS 27.2 and macOS Golden Gate 27.2
Apple Releases First Public Betas of iOS 27.2 and macOS Golden Gate 27.2
1 day ago
OpenAI's New GPT-6 Sol and Luna Models Bring Astra Improvements to Cheaper Tiers
OpenAI's New GPT-6 Sol and Luna Models Bring Astra Improvements to Cheaper Tiers
1 day ago
Apple Park Visitor Center Just Lost an Attraction Offered Since 2017
Apple Park Visitor Center Just Lost an Attraction Offered Since 2017
1 day ago
Shazam App for iPhone Updated With New Icon and iMessage Stickers
Shazam App for iPhone Updated With New Icon and iMessage Stickers
1 day ago
Anthropic Launches Claude Opus 5.5 With Fable-Level Performance at a Lower Price
Anthropic Launches Claude Opus 5.5 With Fable-Level Performance at a Lower Price
1 day ago
Apple Releases Firmware Update for Beats 360
Apple Releases Firmware Update for Beats 360
1 day ago
Beats 360 Pre-Orders Open at Amazon With Cushion Kits on Sale, Plus More Beats Deals
Beats 360 Pre-Orders Open at Amazon With Cushion Kits on Sale, Plus More Beats Deals
2 days ago
Apple Puts AirTag-Sized AI Pin on Hold
Apple Puts AirTag-Sized AI Pin on Hold
2 days ago
Beats 360 Ear Cushion Kits Just $9.99 Each Until the End of October
Beats 360 Ear Cushion Kits Just $9.99 Each Until the End of October
2 days ago
Apple Testing Prototypes of Whoop-Like Screenless Fitness Band
Apple Testing Prototypes of Whoop-Like Screenless Fitness Band
2 days ago
Apple Will Soon Announce an All-New Operating System
Apple Will Soon Announce an All-New Operating System
2 days ago
Apple Watch Series 10 vs. Series 12 Buyer's Guide: Should You Upgrade?
Apple Watch Series 10 vs. Series 12 Buyer's Guide: Should You Upgrade?
2 days ago
Apple's Smart Glasses to Enter a Rapidly Growing Market
Apple's Smart Glasses to Enter a Rapidly Growing Market
2 days ago