NoneType Error for reg.highlight(2)

Asked by Roland Prancan

I get this runtime error "most" of the time, but not all of the time.

NonType error for region.highlight()

here is the code

newReg = setROI(0,0,1440,900)
newReg.highlight(2)

I have other places that has similar code and I get the same error but not every time.

Any ideas?

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
Roland Prancan (rprancan) said :
#1

To be clear

Attribute error: "NoneType" object has no attribute 'highlight'

Revision history for this message
RaiMan (raimund-hocke) said :
#2

setROI() does not define a region, it redefines the relevant part of the screen, that is used to search images (and it in fact returns None).

use
newReg = Region(0,0,1440,900)

Can you help with this problem?

Provide an answer of your own, or ask Roland Prancan for more information if necessary.

To post a message you must log in.