How to perform new line operation using Robin

Hello,

Could you please let me know how can I add new line character or how to press Enter key for Outlook body or any native text files whose body I had captured using Robin UI Spy.

Thanks in Advance

Hi,

How about this:

set body to “Email body - text”
Console.Write Message: body
#append single line
set body to body+’’’
‘’’
Console.Write Message: body
#append two lines
set body to body+’’’

‘’’
Console.Write Message: body

3 Likes

Hi @Bharath.Ram, here’s another way:

set nl1 to "Hello from Robin"
set nl2 to "Goodbye from Robin"
wait 1
System.RunApplication               ApplicationPath:  "C:\Windows\notepad.exe" \
                                    CommandLineArguments:'' \
                                    WorkingDirectory:'' WindowStyle:System.ProcessWindowStyle.Normal \
                                    ProcessId=> ProcessId

MouseAndKeyboard.SendKeys           TextToSend: nl1 + "{Enter}{Enter}" + nl2 DelayBetweenKeystrokes:10 

Regards,
burque505

2 Likes

It occurred to me there is another way you’re not going to send the text to a visible application. (Here I’m still sending it to a visible Notepad, but I don’t need to send ‘{Enter}’.) It doesn’t offer any appreciable benefit over @Skip’s method, though. :grinning:

Code:

set nl1 to "Hello from Robin!"
set nl2 to "Goodbye from Robin."
wait 1
System.RunApplication               ApplicationPath:  "C:\Windows\notepad.exe" \
                                    CommandLineArguments:'' \
                                    WorkingDirectory:'' \
                                    WindowStyle:System.ProcessWindowStyle.Normal \
                                    ProcessId=> ProcessId

Text.AppendLine                     Text:  nl1 \
                                    LineToAppend:'' \
                                    Result=> nl1

MouseAndKeyboard.SendKeys           TextToSend: nl1 + nl2 DelayBetweenKeystrokes:10

Regards,
burque505

2 Likes

Thank you @Skip, @burque505, your solutions worked perfectly :slight_smile:

Regards,
Bharath Ram

2 Likes

Glad to hear it!
Regards,
burque505