Typing a variable automatically presses enter for me.

Asked by sI

0
down vote
favorite
Sorry if this is really basic, I cannot find a workaround. I have a variable called 'doc' that stores the number 510 that was copied from an excel cell.

I need to type it in a field, but I need to continue typing in another field on the same page afterwards.

My code has:

type(doc)
The log shows:

[log] TYPE "510#ENTER."
The full code looks like this:

type(doc)
wait(1)
type(Key.DOWN)
type(Key.BACKSPACE+Key.BACKSPACE+Key.BACKSPACE+Key.BACKSPACE)
wait(1)
type(code)
However, I can't ged to the 'type(code)' because it switches page before I get there...

Thank you for the help, it is much appreciated! S

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
sI
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Your type(doc) is logged as
[log] TYPE "510#ENTER."

this means, that your doc variable is string, that is ended with a \n, which in turn is interpreted as an type(Key.ENTER), which surely activates some ok button.

type(doc.strip()) might help (strips white space from beginning and end of string)

Revision history for this message
sI (belgarionriva) said :
#2

It worked! Thank you so much! You made my day!