Enabled and disabled Button

Asked by Sreelekshmi

Is there a way to check a button whether its enabled or disabled . I have tried pattern("buttonEnabled").exact().Not working.

Using Sikuli1.1.4.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

imgOn = "enabled.png"
imgOff = "disabled.png"

m = <region containing the button>.findBest(imgOn, imgOff)
print m.getIndex(), m.getScore()
if m.getIndex() == 0:
    print "enabled"
else:
    print "disabled"

The details can be found in the docs

Revision history for this message
Sreelekshmi (sree2604) said :
#2

Thank you so much Raiman. It works perfectly.