Jump to content

A very simple word count workflow

Recommended Posts

This workflow is very simple but uses a small piece of AppleScript to display the result in a dialogue box than can be simply dismissed by pressing <Enter>. (I don't always want results copied to the clipboard or displayed in large type so, for me, a small informative dialogue box was the answer.)


The workflow looks like this:




The Universal Action is set to operate on text only (of course). The Automation Task is set to count words and the AppleScript looks like this:




All you have to do, when the workflow is set up, is to select some text, press the Universal Action shortcut keys and run Word count.


I do look forward to hearing from others what you are doing with Universal Actions.



Link to comment
1 hour ago, vitor said:

Have you considered the Dialog Conditional?

Do you know, I never even noticed that in Alfred 5! Thanks so much for pointing it out. As you imply, it's much more versatile than the script I used. I can use that now in several of my workflows: it's really useful.


I thought I'd read carefully all the information on the Alfred help pages about Alfred 5 but I clearly did not do so carefully enough!



Link to comment

Vitor's idea of using the Dialog Conditional action is very much better than my AppleScript so here's what to do if you want to adopt it.


Substitute this (as an example) for my Run Script action:




Here's what my Dialog Conditional action looks like:




Note that for the <Enter> key in the Description box you must press Option + <Enter>. By having Quit the workflow as the first button it's possible to quit the workflow simply by pressing <Enter>.  In the final Clipboard action make sure you include {query} as the text to be copied to the clipboard.



Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...