How can I we represent a new line character in the Clipboard in an Advanced Scripting command?

StackOverflow https://stackoverflow.com/questions/16862872

  •  30-05-2022
  •  | 
  •  

Pregunta

I am writing an Advanced Scripting voice command in Dragon NaturallySpeaking Professional 11.5 to write some MATLAB usual figure commands by voice, namely:

title('')
xlabel('')
ylabel('')

As I would like to write these three lines in one voice command, and the fastest way two output text using Advanced Scripting is to put the text within the keyboard and press Ctr+v, I'm looking for a way to represent new line characters in the Clipboard.

My current script is the following:

Sub Main
    Clipboard("title(''); xlabel('') ; ylabel('');")
    SendKeys "^v"
    SendKeys "{Enter}"
End Sub

and output:

title(''); xlabel('') ; ylabel('');
¿Fue útil?

Solución

vbCrLf will add a new line:

Sub Main
    Clipboard("title('')" & vbCrLf & "xlabel('')" & vbCrLf & "ylabel('')")
    SendKeys "^v"
    SendKeys "{Enter}"
End Sub

will output:

title('')
xlabel('')
ylabel('')
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top