Browse the docs

wordList

Splits text into its words, as a list, without punctuation.

Details #

wordList(text) returns the words as a list of text, using the Mac's tokenizer, so it also finds the words of languages written without spaces, such as Japanese. Punctuation is not a word; don't is one. words only counts the words, splitting on spaces; use this one when you need the words themselves.

Parameters #

Takes 1 argument. {{ wordList(text) }}

Examples #

wordList("Hello, brave new world!")
→ [ "Hello", "brave", "new", "world" ]
length(wordList("don't stop"))
→ 2

Gotchas #

  • Empty text gives an empty list.

  • words() is Keyboard Maestro's count and splits on spaces only, so it counts a Japanese sentence as 1 word; wordList finds its words.