← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #246133]: mismatched input 's' expecting NEWLINE error is raised when I tried to find a region.

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
The above snippet is from a Java program working with Sikuli Java API
(from https://code.google.com/p/sikuli-api/), which of course does only
have a Java level API, which is to some extent feature compatible, but
not on the function level (API level).

the SikuliX equivalent to the first code block:

from sikuli import *
activity = "1395933560122.png"
# ScreenRegion s = new DesktopScreenRegion(); 
#ScreenRegion ActivityNametext = s.find(new ImageTarget(new File("activity"));
#ScreenRegion right = Relative.to(ActivityNametext).right(150).getScreenRegion();
activityNametext = find(activity);
right = activityNametext.right(150)

the Canvas feature is not yet available in SikuliX, so this cannot be transcripted:
Canvas canvas = new DesktopCanvas();
canvas.addBox(ActivityNametext);
canvas.addBox(right);
canvas.display(3);

... but we have highlight:
activityNametext.highlight(1)
right.highlight(1)

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