Stephen_C Posted August 22, 2022 Posted August 22, 2022 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. Stephen vitor 1
vitor Posted August 22, 2022 Posted August 22, 2022 Have you considered the Dialog Conditional? You don’t have to connect it’s output to anything and it’s a “free” way to get a nice dialog. Plus, you can add the options to save to clipboard or show as large type for the rare occasions when you do want that. Stephen_C 1
Stephen_C Posted August 22, 2022 Author Posted August 22, 2022 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! Stephen
Stephen_C Posted August 23, 2022 Author Posted August 23, 2022 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. Stephen
Stephen_C Posted August 24, 2022 Author Posted August 24, 2022 The improved worklfow is now available on Github. Stephen dnszero 1
Lasttoswim Posted December 15, 2022 Posted December 15, 2022 Hi Stephen, can you help me out? Im not sure how to get this working, and im a bit of a newb. When i download your workflow on github, the "automation task" just reads "No task"?
Vero Posted December 15, 2022 Posted December 15, 2022 21 minutes ago, Lasttoswim said: the "automation task" just reads "No task"? Double-click the Automation Task itself, and take a look at the bottom left. You'll see either "Install tasks" or "update tasks"; Once you click on this, the Automation Tasks will be populated, and the workflow will start working for you More details on Automation Tasks here: https://www.alfredapp.com/help/workflows/automations/automation-task/
Stephen_C Posted December 15, 2022 Author Posted December 15, 2022 Thanks for stepping in @Vero and sorry not to have seen @Lasttoswim's post before now. It's not always a good idea to have decorators in for a week not long before Christmas! 😀 Stephen
adamprocter Posted January 27, 2023 Posted January 27, 2023 This is exactly what I was looking for as I need to count word in various web interfaces but I cannot for the life of me get it to work? macOS Ventura Alfred 5 I have CMD+Space to trigger Alfred downloaded this workflow I then installed the automated tasks I also changed universal actions to cmd+/ (this doesnt do anything ?) I have powerpack of course. I always feel I so under use alfred and this is classic example I find something that looks great but I cant figure out why it doesnt work. I find the Alfred guides are also very wordy and I find them confusing... Any tips on how this is suppose to work or what setting I have set up incorrectly would be much appreciated.
vitor Posted January 27, 2023 Posted January 27, 2023 11 minutes ago, adamprocter said: I also changed universal actions to cmd+/ (this doesnt do anything ?) Select some text then press the shortcut.
adamprocter Posted January 27, 2023 Posted January 27, 2023 ah ha thank you so much was being really stupid ! I got really confused about the guide also mentioning press right cursor ... thanks again
vitor Posted January 27, 2023 Posted January 27, 2023 12 minutes ago, adamprocter said: I got really confused about the guide also mentioning press right cursor That’s something you can do when acting on a result from Alfred itself. I.e. when you’re searching for files or looking at an entry from the Clipboard History. The Universal Actions shortcut will also work in those situations, though.
vurte Posted May 18, 2023 Posted May 18, 2023 This looks very useful. A small request: Do you think it can show character count too?
Stephen_C Posted May 18, 2023 Author Posted May 18, 2023 Yes—I think that's an easy modification. Let me take a look… Stephen vurte 1
Stephen_C Posted May 18, 2023 Author Posted May 18, 2023 @vurte here you are: here is the GitHub link for the new workflow. As the old one is on the Alfred Gallery I've not modified that but instead have created a new workflow which can count either words or characters…whichever you choose. Stephen
Stephen_C Posted May 18, 2023 Author Posted May 18, 2023 On reconsidering your post I think what you needed was for both counts to be output so I'm changing the workflow to do that and will post an updated workflow in a moment. Sorry for initially not understanding that you wanted to see both. Stephen
Stephen_C Posted May 18, 2023 Author Posted May 18, 2023 Version 2.0 now released: showing both word and character counts in the result. Stephen vurte 1
vurte Posted May 18, 2023 Posted May 18, 2023 That's exactly it, thank you so much for modifying it, hope it's useful for everyone else too! 👍 3 hours ago, Stephen_C said: Version 2.0 now released: showing both word and character counts in the result. Stephen Stephen_C 1
christinekling Posted October 21, 2023 Posted October 21, 2023 I would love to get this to work and I feel like an idiot that I can't. I'm assuming that there is some key combination that is supposed to activate this workflow, but I can't for the life of me find it or figure out how to program it.
vitor Posted October 21, 2023 Posted October 21, 2023 21 minutes ago, christinekling said: I'm assuming that there is some key combination that is supposed to activate this workflow It’s what you have set for Universal Actions, by default ⌘/.
christinekling Posted October 22, 2023 Posted October 22, 2023 By following your link to Universal Actions, I was able to find it as a Feature and discover what was set as the key strokes on my Mac. Been using Alfred for over 10 years, so I must have changed it from the default at some point. This really makes me realize how much I underutilize the capabilities. Anyway, thank you for pointing me in the right direction.
Stephen_C Posted October 22, 2023 Author Posted October 22, 2023 1 hour ago, christinekling said: This really makes me realize how much I underutilize the capabilities. I'm glad you sorted it. Universal Actions are really good and useful. Stephen
iangreig Posted March 4, 2024 Posted March 4, 2024 (edited) I'm a long-time Alfred user but new to PowerPack. I installed Stephen Christy's word count but can't find a way to add a hotkey or other way to trigger it. The general Alfred search doesn't. Apologies if I'm missing something basic. Edited March 4, 2024 by iangreig
Stephen_C Posted March 4, 2024 Author Posted March 4, 2024 I'm the author of that workflow. The workflow uses Alfred's Universal Action so you need simply to select some text, use your Universal Action hotkey (go to Alfred Preferences → Features → Universal Actions) and then look among the results for "Word and character count” (just start typing and it should appear quickly). Let me know if you still have problems. Stephen
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now