← Back to team overview

sikuli-driver team mailing list archive

[Question #678863]: [1.1.4 ] collectWords dosn't find a word

 

New question #678863 on Sikuli:
https://answers.launchpad.net/sikuli/+question/678863

I am new to Sikuli and I am not a developer, but I did my best to read the docs. Probably I missed anyway something  for OCR-setup. I already did some successfull scipts for Html/Javascipts Apps and for some Windows-Apps. Now I want to get the text and the position of new and unknown Objects, e.g. usernames, wich I can't click/mark, because they are starting a function or a hyperlink. So collectWords() would be the best method.
This is my code:
...
Settings.OcrTextRead = True
#tr = TextOCR.start() 
#tr.setLanguage("eng")
#logger.warning('tr = %s', tr)
words =  Region(38,381,282,28).text() 
logger.warning('words = %s', words)
#words = SCREEN.getWords() #Screen object has no attribute getWords
words = SCREEN.collectWords()
logger.warning('words = %s', words)
words = Region(19,323,675,268).findAllText("Administrator") 
logger.warning('words = %s', words)
#firstWordMatch = words[0].getText() 
#firstWord = firstWordMatch.getText() 

Region.text() and Region.findAllText("mySearch") works fine, but this is not the function I need.
Region. collectWords(), Region. collectWordsText(), Region. collectLines(), ... don't throw an error, but find nothing: Result is [0]
When enabled getText() throws an error and color of this method call in SikuliX IDE keeps black. Color of collectWords() is not blue/green like findAllText(), but keeps black,too. ?!?
I tested this code with all kind of apps/texts and got allways the same result.

My Environment:
Windows 10, latest Java 64, Folder of Sikulix 1.1.3 installation got renamed, old Appdata-Folder of 1.1.3 got renamed.
I did same for the 1.1.4 installation wich i used until today. This Installation had both, Jython and JRuby support and some Tesseract-files. 
Now I did a new installation of last night version of 1.1.4 and only Jython, nothing else. No additional configuration, only the 
Settings.OcrTextRead statement in the script.
Resul of new installationt:
Nothing changed

By the way:
Do I need the tr = TextOCR.start() stuff?


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.