click

click <location&gt

click on a point as specified by the <location&gt

Sikuli

All Sikuli commands are run through the vision command from within TagUI.

Command Usage

  1. You can click a location, by specify the x position and y position.
  2. vision click(Location(300,900))
    • This clicks the coordinate (300,900) of the primary screen.
    • 300 is the x position, and 900 is the y position.
    • For Sikuli, (0, 0) is the top left-hand corner. x extends from left to right. y extends from top to bottom.
    • This only works on the primary screen. If you have multiple monitors, it does not click the other monitors, only the primary.
  3. You can click on an image by using the find command.
  4. vision click(find('C:/apps/scripts/img/test1.png'))
    • This clicks the image in the location: C:/apps/scripts/img/test1.png
    • Note that you need to specify the full path to the image. Contrast this with the TagUI click command, which takes in relative path.
    • For windows, DO NOT use the backslash for the path separator. Replace all backslash (\) with forward slash (/)
  5. You can also click on =an offset from an image by using the find, followed by the Sikuli offset command.
  6. vision click(find('C:/apps/scripts/img/test1.png').offset(60, 40))
    • The above will offset the found image by x=60 and y=40
    • As in (2), you need to specify the full path to the image. Contrast this with the TagUI click command, which takes in relative path.
  7. To offset to the right, you can use
  8. vision click(find('C:/apps/scripts/img/test1.png').offset(60, 0))

    or

    vision click(find('C:/apps/scripts/img/test1.png').right(60))
  9. To offset to the left, you can use
  10. vision click(find('C:/apps/scripts/img/test1.png').offset(-60, 0))

    or

    vision click(find('C:/apps/scripts/img/test1.png').left(60))
  11. To offset to the point below, you can use
  12. vision click(find('C:/apps/scripts/img/test1.png').offset(0, 40))

    or

    vision click(find('C:/apps/scripts/img/test1.png').below(40))
  13. To offset to the point above, you can use
  14. vision click(find('C:/apps/scripts/img/test1.png').offset(0, -40))

    or

    vision click(find('C:/apps/scripts/img/test1.png').above(40))

Comments (0)

There are no comments posted here yet

Leave your comments

Posting comment as a guest. Sign up or login to your account.
Attachments (0 / 3)
Share Your Location