Paste() doesn't work "perfectly"

Bug #1675740 reported by Alex

This bug report was converted into a question: question #588177: Paste() doesn't work "perfectly".

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Invalid
Undecided
Unassigned

Bug Description

Hi,

Sikuli Version : 1.1.0
OS : Windows 10 x64

I'm using Sikuli and in my script i'm using "paste(ucode("trolol;dsqjklds546$))"

The problem is that sometimes it works, sometimes not.
When it works, the text is pasted correctly.
When it doesn't the text is not pasted and the script continues like nothing happened...

What did I do wrong ?

Thanks.

Revision history for this message
RaiMan (raimund-hocke) wrote :

usually a timing problem: the GUI is not yet ready to accept the paste, because your script is too fast ;-)

put a short but sufficient wait (try wait(0.5)) before the paste()

Revision history for this message
RaiMan (raimund-hocke) wrote :

should have been posted as a question

Changed in sikuli:
status: New → Invalid
Revision history for this message
Alex (alexboost) wrote :

I already put a sleep(1) before, it should be enough no ?

Revision history for this message
Todd Davies (fomx) wrote :

Hi Raimund,

I have a machine in my office that has this problem and adding sleep doesn't solve it. It seems unique to windows 10 though and not related to the where you are pasting. Consider the following that pastes into a text editor.

for _ in range(20):
    for i in range(10):
        sleep(1)
        paste(i)
    type(key.Enter)

This will fail to paste() a random number and doesn't seem dependent on how long the sleep() function is.

This should perhaps be a windows10 specific bug.

Revision history for this message
RaiMan (raimund-hocke) wrote :

@Todd Davies
a syntactical correct and reproducible example would be:

# supposing the text window is the frontmost behind SikuliX so it has focus after script start
for _ in range(20):
   for i in range(10):
       paste(str(i)) # paste needs a string
   wait(1)
   type(Key.ENTER) #key.Enter is wrong

... and works on Windows 10 (64Bit latest)

Please post your own question so you get notified of answers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.