-1
reg = Region(20,30,40,50)
reg2 = Region(60,70,80,90)
reg.moveTo(reg)

When I run this program I got the following error

TypeError: moveTo(): 1st arg can't be coerced to org.sikuli.script.Location

Confused with moveTo(), Could anyone help me out??

Praveen kumar
  • 597
  • 2
  • 14
  • 26

2 Answers2

2

Try

reg.moveTo(reg.getTopLeft())

Your code does not work because you are passing a Region object to moveTo() instead of a Location object. Region has 2 additional values for width and height.

Niccolò
  • 2,854
  • 4
  • 24
  • 38
1

Niccolo's answer is correct. Working script example:

reg = Region(20,30,40,50)
loc = Location(10,10)
reg.moveTo(loc)

"moveTo" documentation: http://doc.sikuli.org/region.html

Marcin Kowalczyk
  • 649
  • 6
  • 17