Error in type() method

Asked by Vaishali

I am using eclipse.. s.type("<doc>\n<field name="MobileName">\n") i want to type this line in notepad. bt it throws an error.
Syntax error on token MobileName.. bt i want that quotes to be typed...

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
obiwan-92
Solved:
Last query:
Last reply:
Revision history for this message
Best obiwan-92 (obiwan-92) said :
#1

Hello,
Try to use the function paste instead.
In your example :
paste("<doc>\\n<field name=\"MobileName\">\\n")

Hope it's help.

Regards.

Revision history for this message
obiwan-92 (obiwan-92) said :
#2

One thing more :

The code
paste("<doc>\\n<field name=\"MobileName\">\\n")
will write
<doc>\n<field name="MobileName">\n

If you want to write in notepad (make more sense) :
<doc>
<field name="MobileName">
you need to use this line :
paste("<doc>\n<field name=\"MobileName\">\n")

Regards.

Revision history for this message
Vaishali (vaishoo-vasu) said :
#3

Thanks obiwan-92, that solved my question.