Type a GREP Command String via Keyboard Maestro

I want to set up Keyboard Maestro to type GREP commands for me, so I don't have to remember them.

This is the command I would like Keyboard Maestro to type:


I am using "Insert text by pasting" to do this.

But when I run the Macro, Keyboard Maestro outputs the following:


How can I get it to type the original .*\n.*\n without trying to interpret it?

(I have also tried "Insert text by typing" but it has the same result).

To not have KM interpret a grep character like this, you need to escape each backslash with another backslash:



Alternatively, in the action (gear) :gear: menu, you can select to not process tokens or backslashed characters in most actions.


Hey Madhu,

Are you using a text-expansion with a typed-string trigger? Or something else?

Here's a possible alternative with a pick-list that can contain tags.

Insert GREP Command String Pick-List v1.00.kmmacros (6.6 KB)


Hey Peter – the Prompt with List dialog is set to WIDE – but even so it is unnecessarily truncating my lines of text.

I hope Keyboard Maestro v9 has some remedies for this sort of problem. :innocent:


1 Like


  • Fixed an issue with Prompt With List action not showing as much as possible of long entries.