Home›How to Set Up a System-Wide Word Count Service on Your Mac

How to Set Up a System-Wide Word Count Service on Your Mac

VINKOWEB • TECHNOLOGY ARTICLE

How to Set Up a System-Wide Word Count Service on Your MacFriday May 11, 2018 12:14 AM PDT by Tim HardwickIn this article, we're going to show you how to create a system-wide service that enables you to get an immediate word count

How to Set Up a System-Wide Word Count Service on Your Mac

Friday May 11, 2018 12:14 AM PDT by Tim Hardwick

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.


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.

  2. Click New Document.
  3. Choose Service as the type of your document.

  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.

  5. In the Run Shell Script action window, change the Pass Input: option to as arguments using the dropdown menu.

  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

  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.

  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.

  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.

  11. Now, drag your "count" variable from the variable list up to the "Message" title in the Ask for Confirmation action.

  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.


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.

Tag: Automator
Related Forums: macOS High Sierra, macOS Sierra
27 comments

Popular Stories

Apple Responds to iPhone Duo Display Cracking Reports

Monday October 26, 2026 10:20 am PDT by Juli Clover
Shortly after the iPhone Duo launched, a few users reported hinge issues that were causing cracks in the inner display. Apple has now responded to the reports in a statement to MacRumors, saying a small number of units are affected. The response to iPhone Duo from early users has been incredibly positive, and we are seeing exciting things from developers who are rapidly updating their apps...

Crackgate? iPhone Duo Owners Report Screens Breaking Along the Hinge

Friday October 23, 2026 11:05 am PDT by Juli Clover
Some iPhone Duos are already experiencing hinge issues that cause display cracks, based on photos shared on Reddit and the MacRumors forums. Almost all of the display faults are right along the hinge, and most result in a line of bright pixels across one side of the screen. An iPhone Duo owner in Australia said his device cracked after being opened fewer than 20 times, and there was no...

Apple Announces New iPad Mini With 8.5-Inch OLED Display, A20 Pro Chip, and More

Monday October 26, 2026 6:05 am PDT by Joe Rossignol
Apple today announced a new iPad mini with a larger 8.5-inch OLED display, a nano-texture display option, a thinner and lighter design, an A20 Pro chip, a new Acoustic Display audio system that eliminates speaker holes, IP67-rated water and dust resistance, a landscape front camera, Apple's N1 chip with Wi-Fi 7 and Bluetooth 6 support, and more. Altogether, Apple says this amounts to the iPad...
'); }

Next Article

Related articles

Boot CampBoot CampBy MacRumors Staff on August 22, 2022Jump to How Tos ArticlesBoot Camp How TosHow to Install Windows 10 on Your Mac Using Boot CampRead full story →
Losing Two-Factor Recovery Key Could Permanently Lock Apple IDLosing Two-Factor Recovery Key Could Permanently Lock Apple IDMonday December 8, 2014 10:32 pm PST by Husain SumraIn March 2013, Apple introRead full story →
Apple Two-Step Verification Now Available for iMessage and FaceTime [Updated]Apple Two-Step Verification Now Available for iMessage and FaceTime [Updated]Thursday February 12, 2015 12:50 pm PST by Juli CloverApple's tRead full story →
Apple Increases Account Security With Optional Two-Step Verification System for Apple IDsApple Increases Account Security With Optional Two-Step Verification System for Apple IDsThursday March 21, 2013 12:26 pm PDT by Juli CloverRead full story →
Apple to Take Reservations for Trying On Apple Watch, Considered Platinum ModelApple to Take Reservations for Trying On Apple Watch, Considered Platinum ModelMonday March 9, 2015 7:35 am PDT by Joe RossignolApple is shiRead full story →
Open full interactive page →