← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #269440]: Sikulix 1.1.0 Onchange-problem

 

Question #269440 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/269440

    Status: Answered => Solved

Dr. Xenofon Nastos confirmed that the question is solved:
Looks good now, this is the working code sniplet with the build from
yesterday:

import org.sikuli.script.TextRecognizer as TR
Settings.OcrReadText = True
Settings.OcrLanguage = "deu"
TR.reset()
print "Anfang"
def changed(event):
    print "something changed in ", event.getRegion()
    event.getChanges()[0].highlight(2)   
    menustring = event.getChanges()[0].text()
    menustring = menustring.replace(" ", "")
    print menustring.encode("utf-8")
        
onChange(1000,changed)
observe(FOREVER, background=True)

try: 
    z = "Datei"
    match = findText(z)
    menu = match.getTarget()
    menu.click()
    pass
except FindFailed:
    pass

wait(10)
stopObserver()

Thanx a lot Raimund!

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