I'm trying to getCell but having trouble

Asked by Ali Ahmed

So this is script I'm using but its not getting Cell value. I think my syntax is correct. When I run it nothing appears in console.

r=Region(222,138,1080,395)
r.setRows(15)
r.setCols(17)

r.getCell(3,4)

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

A defined region by Region feature is not visible.
It's the same as that.
Use highlight feature If you want to conferm divided row, col and cell.

[example]
r=Region(222,138,1080,395)
MAXROWS=3
MAXCOLUMNS=3

r.setRows(MAXROWS)
for row in range(MAXROWS):
    r.getRow(row).highlight(1)

r.setCols(MAXCOLUMNS)
for col in range(MAXCOLUMNS):
    r.getCol(col).highlight(1)

r.setRaster(MAXROWS,MAXCOLUMNS)
for row in range(MAXROWS):
    for col in range(MAXCOLUMNS):
        r.getCell(row,col).highlight(1)

Revision history for this message
masuo (masuo-ohara) said :
#2

If you want to get text in the divided cell, try ocr feature.
https://sikulix-2014.readthedocs.io/en/latest/textandocr.html

Can you help with this problem?

Provide an answer of your own, or ask Ali Ahmed for more information if necessary.

To post a message you must log in.