Ah, I see the ambiguity. I am not talking about filesystem folders. I am talking about Alfred Workflow folders. Sorry about that.
See attached diagram.
That works, thank you. I have been looking for a way to do that ... and with a minor modification it can be used as a Universal Action:
on run
set theWordCount to count words of ("{query}" as string)
display dialog (theWordCount & " words in the selected text." as string)
end run
I have both an Alfred folder and an Alfred 3 folder in my ~/Library/Application Support. Can I delete the Alfred 3 folder without concern? (I am running Alfred 4 for several months now).