Sikuli ide special caracters :, \ doesn' t pass through

269 Views Asked by At

I am using Sikuli ide,

I want to do a very simple type("1440144711350.png", "C:\tests\exportDest.csv")

But it doesn' t seems to work, when i run it, i got errors, what' s the problem may be coming from ?

Thanks

1

There are 1 best solutions below

0
On

From your code, I suppose you are trying to find or open a file from the windows explorer, or something similar.

The type function simulates the Standard US keyboard, can be tricky if you do not have one. Have a look to SikuliX documentation on the function type. You certainly then have to prefer the method paste

The second issue you certainly encounter is linked to the backslash that is interpreted in your string (for example \t is interpreted as tab). you have to escape them with a \\ To verify it: simply paste (Ctrl+V) in atext editor after running your script can provide you an idea what sikuli tried to paste...

    paste("1440144711350.png", "C:\\tests\\exportDest.csv")

if needed you can simply press the enter key afterwards as following:

    paste("1440144711350.png", "C:\\tests\\exportDest.csv")
    type(Key.ENTER)