Pragmatism in the real world

Global word count on Mac using Shortcuts

I’ve had a few cases recently when I wanted to know the number of words that I had written. To do this, I’ve copied the text to BBEdit which displays the word count in its status bar, but this is a bit of a faff.

I finally sat down and created a Shortcut for it that took 10 mins.

This is the shortcut:


Screenshort of Word Count shortcut

The idea is that I want to select the text and run the shortcut without having to copy to the clipboard, so to do this, I enable “Use as Quick Action” on the Services menu. I also assigned a global shortcut of ⌃⌥⇧⌘W for convenience, though going to the Services menu isn’t hard.

A Quick Action shortcut automatically gets a “Receive” input block, which I set to be just accept text input as it makes no sense to count words in other types of text. I also set it to look in the clipboard if there’s no selection. Once we have input, we run it through the “Count” action and then pipe to a “Show Alert” so that the value can be seen. It’s all quite easy.

That’s it. I can now select text and press

⌃⌥⇧⌘W

and the number of words is displayed!


Screenshort of output of Word Count shortcut

Thoughts? Leave a reply

Your email address will not be published. Required fields are marked *