Sikulix 1.1.0 handler return value

Asked by Dr. Xenofon Nastos

I have the following problem: an onChange Event fires a handler that reads some text using OCR and puts this in a string variable.
I want to access this variable from outside the handler. Unfortunately this doesn't work as I thought it would:

def changed(event):
    menustring = event.getChanges()[0].text()
    return menustring

Any idea?

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

def changed(event):
    global menustring
    menustring = event.getChanges()[0].text()
    return menustring

Revision history for this message
Dr. Xenofon Nastos (xenofon-nastos) said :
#2

Thanks RaiMan, that solved my question.