[1.0] Text search currently switched of - how to switch on in Sikuli API?

Asked by Ricardo Cardona Ramirez

Hi all,

Currently i have the script (Sikuli X r930):

  reg = App('Microsoft Word').window(0)

  #Look for text
  reg.wait('Home')

But when run in Sikuli API 1.0 i have error:

  [error] Region.find(text): text search is currently switched off
  [error] script [ TestText ] stopped with error in line 6
  [error] FindFailed ( Text search currently switched off )

Doing some tests in IDE i changed the option Preferences\"Allow searching for text", and now i don't get that error, but i don't know how enable it in Sikuli API.

The other problem: enabled text search and Making more tests in the IDE, I have this error when the window is maximized:

  [debug] getWindow: java.awt.Rectangle[x=-4,y=-4,width=1448,height=908]
  [error] Region (1448, 908) outside any screen - subsequent actions might not work as expected
  [error] script [ TestText ] stopped with error in line 6
  [error] FindFailed ( null )

What can I do for?
  1. Enable "Allow searching for text" in Sikuli API.
  2. Find text when the window is maximized.

Thanks in advance

Ricardo Cardona R

Question information

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

use
Settings.OcrTextSearch = True

to switch on text search outside the IDE

The other OCR/text related option is
Settings.OcrTextRead

which is switched of in the standard.

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

I am tracking the Region error in the other question.
https://answers.launchpad.net/sikuli/+question/229401

Revision history for this message
Ricardo Cardona Ramirez (ricardona) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
Suresh (sureshachanta02) said :
#5

I too have the same issue can you please give me a solution

Revision history for this message
Eugene S (shragovich) said :
#6

The solution is the first comment to this question.

Revision history for this message
Suresh (sureshachanta02) said :
#7

I tried with that but again the same problem .. please help me