How can I replace text containing multiple lines

Depite being a novice I successfuly created some macros in order to search and replace certain characters and special characters in documents opened in TextWrangler.

But now I got stuck. When I insert the text containing multiple lines, the macro is not executed. The text is not replaced by a comma + space.

I am attaching both the screenshot of the actions that should be performed, and the macro itself. Where did I make a mistake? I would appreciate any helpful suggestion.

Test.kmmacros (4.6 KB)

The string in the red action in your macro (Insert Text) contains a linbreak. If you insert the text by typing that line break will literally be typed as Return. That is, it presses the default button (the blue Next button) of the Find window.

So, change “Insert text by typing” to “Insert text by pasting” and see if it works.

Thank you, Tom, that is the solution.

You’re welcome. If it was the solution you could click the Solution checkbox of the post with the solution.

Am I right having the feeling that text by typing is executed faster than text by pasting?

Generally speaking, pasting is much faster than typing, assuming you're talking more than one character.

Actually, it is probably more than a few characters - it probably crosses over around 5 characters, although it is highly application and Mac dependent.

See the wiki FAQ for more discussion on when to use which.

https://wiki.keyboardmaestro.com/Frequently_Asked_Questions#When_should_I_use_Insert_Text_by_Typing_instead_of_by_Pasting