Shayon Pal
Shayon Pal
Shayon Pal
Shayon Pal
  • About Me
  • Services
  • Experience
  • Uses
  • Blog
  • Let’s Chat!
Menu
  • About Me
  • Services
  • Experience
  • Uses
  • Blog
  • Let’s Chat!
Twitter
Linkedin
Instagram
  • Alfred, Automation

Count the number of words using Alfred Workflow on macOS

Many a time, when I write for publications, I need to constantly limit myself to a certain number of words. I also need to keep a track of the same while designing websites, or copyediting someone else’s articles. I know that there are apps like Ulysses and Draft that monitor the same, but it becomes a hassle to copy and paste text when I am working on other applications. To mitigate that constant irritation, I decided to write an Alfred workflow and automate this task. I’ve bound the workflow to the keyboard shortcut cmd+ctrl+B. The moment the workflow is triggered, Alfred passes the text I have selected to the workflow and calculates the number of words using a bash script.

Here is a demonstration of how this works.

Counting the number of words using Alfred
Counting the number of words using Alfred

The Script

Here’s the Bash script I used to calculate the number of words.

input="{query}"
words=( $input )
echo ${#words[@]}

The Workflow

Here’s the Alfred workflow that you can download and import into your Alfred setup to start using it.

It is also possible to trigger the workflow by simply typing count on Alfred search bar after copying the text into the clipboard.

Download Workflow ⇣

  • October 28, 2020
  • No Comments
alfredautomationbash script
PrevPrevious PostIntegrate Siri Shortcuts with Notion note-taking app
Next PostWorking from Home means you have to fight the tyranny of the urgentNext

Leave a Comment

Leave a Reply Cancel reply

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

About Me

Hello, I’m Shayon! I’m a technology consultant, who is also a lot of other things on the side. I love to code for fun. I am also a half-decent cook and a whiskey snob. In my previous life, I also used to compete professionally in video games. I am passionate about pets and have a Labrador named Sugar. I’m also an Apple fan.

If you’d like, you can reach out to me on Twitter, Instagram, LinkedIn, or by using the contact form on this website.

Recent Posts

Life as a Freelancer

Working from Home

Working from Home means you have to fight the tyranny of the urgent

Count the number of words

Count the number of words using Alfred Workflow on macOS

Notion - featured image

Integrate Siri Shortcuts with Notion note-taking app

Productivity apps I use

10 Best Productivity Apps for macOS

E-commerce Conversion Funnel

Product Analytics can help improve your E-commerce Conversion Funnel

Life as a Freelancer

Working from Home

Working from Home means you have to fight the tyranny of the urgent

Notion - featured image

Integrate Siri Shortcuts with Notion note-taking app

Productivity apps I use

10 Best Productivity Apps for macOS

E-commerce Conversion Funnel

Product Analytics can help improve your E-commerce Conversion Funnel

Automation Workflows

7 useful automation ideas for Alfred App on macOS

Share this Article

Share on email
Share on facebook
Share on twitter
Share on whatsapp
Share on linkedin
  • About Me
  • Services
  • Experience
  • Uses
  • Blog
  • Let’s Chat!
Menu
  • About Me
  • Services
  • Experience
  • Uses
  • Blog
  • Let’s Chat!
Twitter
Linkedin
Instagram