Capturing Text in Region with Mouse events, if text can be selected and copied using ctrl/cmd-c
Asked by
Dave
I would like to share a solution that allows one to capture the text from a region using Mouse events.
reg = selectRegion() # dynamically define region
hover(reg) # by default focus is on center point of region
mouseMove(-120, -20) #refocus to upper left of region, numbers depend on region size
mouseDown(
mouseMove(240, 40) # highlights entire region
mouseUp(
reg.type("c", KEY_CTRL) # copy highlighted text
value = Env.getClipboard()
print str(value) # prints contents of region
There may a more elegant solution; but this is at least one solution!
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
To post a message you must log in.