A note on creating JSON-structured KM variables – double escape \n \t etc

There are useful notes and examples on accessing parts of JSON-structured KM variables at:

token:JSONValue [Keyboard Maestro Wiki]

perhaps worth adding that if you want to create such variables using a Set Variable ... to text action, any back-slashes in newlines (\n) or tab (\t) characters within quoted strings need to be doubled.

So, for example:

image

to create a KM variable value like:

{"a":9, "b":"bravo", "c":null, "d":"a\nb\nc\nd\ne"}

4 Likes