Comment 3 for bug 850520

Revision history for this message
Ben Turner (ben-turner) wrote : Re: X-1.0rc3: IDE: "with Region" doesn't work after first run - uses whole screen

Darn, I've just converted quite a few blocks of my code to use the "with Region" paradigm, such as :

 with Region(find(Pattern("ALLIEI.png").similar(0.98))):
  rightClick(Pattern("ALLIEI-1.png").similar(0.80).targetOffset(-1,29))
  click("createItem.png")
  type(Pattern("1324945448304.png").similar(0.80), "Baldrick")

In this case, the type command is hitting a single blank line - which matches hundreds of places, but within the region it only matches one. And, of course, it's not working as it's not respecting the "with Region" command.

The workaround for now appears to be:

 r = Region(find(Pattern("ALLIEI.png").similar(0.98)))
 r.rightClick(Pattern("ALLIEI-1.png").similar(0.80).targetOffset(-1,29))
 r.click("createItem.png")
 r.type(Pattern("1324945448304.png").similar(0.80), "Baldrick")

Would be great to see this working, as the blend of the "with Region" command and Sikuli Syntax would be really quite powerful.