← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #230384]: help with reg.find

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
this would be my approach:

   for i in range(numPages):
        if searchReg.exists(Pattern("1370620830920.png").similar(0.99), 0): 
            # found a blank page pattern
            type('D', KeyModifier.SHIFT + KeyModifier.CTRL) # and delete it
            wait(0.5)
            type(Key.ENTER)
            wait(0.2)
            type(Key.ENTER)
        else: # if blank page not found, go to next page
            type(Key.RIGHT)
            wait(1)

- take care that the shot for Pattern("1370620830920.png") is good enough to always produce a similarity of 1.0 for a blank page
- I use exists(image, 0), to immediately return after the first search and to be able to use if/else
- added a wait when switching to next page, to assure that the switching has finished properly before the next search

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