How do I break the line to show a message like this?
My macro displays:
${!col1}, this is a customized message.Adding a new line
But I’d like to split the text in 2 lines – see below:
${!col1}, this is a customized message.
Adding a new line
My macro
{
"Command": "store",
"Target": "${!col1}, this is a customized message.\\nAdding a new line\\n",
"Value": "message"
},
{
"Command": "XType",
"Target": "${MESSAGE}",
"Value": ""
}
This issue will be solved with the next update in about one week is solved:
Then we will have a new internal variable to control how escape characters are interpreted in TYPE and SENDKEYS: !stringEscape
store | true | !stringEscape(default) => \n \t are interpreted as escape strings (this is what you need). This works just as Javascript does, so \t is tab and \n is new line (etc). Like here: JavaScript character escape sequences · Mathias Bynens
store | false | !stringEscape => literal interpretation. For example this is useful when filling in a file path, e. g. c:\next\time\text.txt is entered exactly as this.)
XTYPE simulates native keyboard presses, so \n is typed just as the letters \ and n. For line breaks with XTYPE use ${KEY_ENTER}.
@admin can you confirm behavior is as expected for prompt? How can I enter text into a prompt that includes newlines and have that variable used in a type command as expected with the default !stringEscape set? Currently, it just types out “this is a line\nthis is a second line”, which I don’t want.
I want to enter into the prompt whatever I need to, so that the result can be stored as a variable and later the type command can be used to send text to a text box that includes newlines. For example:
This is a line
This is another line
Now that I think about it, perhaps my issue is with the type command, not prompt. I don’t have it in front of me at the moment.