Split text and iterate over each character

Hi all

Perhaps I am missing something obvious but I want to be able to take a string from a user and then iterate over each letter. I couldn't see anything in the For Each action that fit.

Is there some way to do this or am I going to have to run it in JavaScript?


Can you tell us the context and the role of the iteration ?

What's the output, in relation to the input string ?

You can use a For Each action with the simplest (single dot) regular expression, but there may be a more direct route to the transformation or effect that you are after.

Characters one by one.kmmacros.zip (1.8 KB)


Well I didn't realise that I could use a regex in the substring selection field.

Spending too much time in apps that have distinct regex options.

That should absolutely do it. I'll test it out and let you know


Totally worked.

I am duplicating a workflow that I created in Shortcuts. It asks the user for a word and then opens Freeform and pastes in images that match each letter in the text they entered.

Thanks again