Replace the beginning of each line

I am trying to create a macro to add a character to the beginning of each line. But it only applies it to the first line.

Type the ⌘X Keystroke

Set Variable ‘clip’ to Text %CurrentClipboard%

Search and Replace Variable ‘clip’ Using Regular Expression (ignoring case)
Search for “^”
Replace with “//”

Set Clipboard to Text %Variable%clip%

Type the ⌘V Keystroke

Hey There,

You have to tell the regular expression to work with multiple lines.

Find:
(?m)^

Replace:
//


Best Regards,
Chris

3 Likes

Worked, thanks Chris!