← Back to team overview

sikuli-driver team mailing list archive

[Question #256247]: How can I use if exists("some copied text"):

 

New question #256247 on Sikuli:
https://answers.launchpad.net/sikuli/+question/256247

Hi I have used following code-

click(Pattern("141445.png").targetOffset(-40,13))
    sleep(2)
    click(Pattern("14146707.png").targetOffset(-45,13))
    sleep(2)
    mouseDown(Button.LEFT)
    hover(Pattern("148.png").targetOffset(23,13))
    sleep(2)
    mouseUp()
    sleep(2)
    type('c',Key.CTRL)
    job = Env.getClipboard().strip() 
    
    sleep(2)
    click("1414403473103.png")
    sleep(2)
    click("1414403921643.png")
    sleep(2)
    click("1414403944015.png")
    sleep(2)
    click("1414403703293.png")
    sleep(2)
    click("1414403986647.png")
    sleep(2)
    click(Pattern("1414404375829.png").targetOffset(-22,8))
    sleep(2)
    click("1414404180540.png")
    type('v',Key.CTRL)
    sleep(2)
    click("1414405747512.png")
    
    sleep(2)

    if not exists(job):
        print " search is working fine"
    else:
        print "Not working"


I got following output in message section-  
"

Ran 0 tests in 0.000s

OK

[error] TextRecognizer: init: tessdata folder not found at C:/Users/Administrator/Downloads/libs/
[error] Region.find(text): text search is now switched off
[error] Region.exists: seems that imagefile could not be found on disk

"
     Please advise me how to use a copied text (job) in if exists() loop.


Thanks,
   

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.