How to iterate a list of string, using Sikuli
<p>I am using sikuli to automate an application; it process a file and save the output of this file.</p>

<p>I am taking a snapshot of the file itself, so Sikuli can find it, but I have to process 30 files; so taking 30 snapshot of each file is really not that logic. Is there a way to loop through a list of files, as string, so Sikuli can read the file name and retrieve it from a folder, instead of me taking snapshots of everything?</p>

<p>I did try to use the file name passed as text, but I get an error from Sikuli, since it can't find the file. </p>

<p>I call <code>findText("myfile.txt")</code> when the file prompt is on screen, but I get an error:</p>

<pre><code>[error] TextRecognizer: init: export tessdata not possible - run setup with option 3
[error] TextRecognizer not working: tessdata stuff not available at:
/User/test/Library/Application Support/Sikulix/SikulixTesseract/tessdata
[error] FindFailed ( null )
</code></pre>

<p>I did check with Google and found not much. I am aware that Sikuli is mainly for snapshot automation, but it has python bindings for Java, so it can use python logic like if cycles and other construct, so I assume there should be a way to process multiple files via code.</p>

<p>I still don't completely understand what are you trying to do but the <code>findText()</code> function that you are using is actually attempting to find text on the screen by using OCR extraction of text in the region. Are you sure that's what you want to do? If yes you have to:</p>

<ol>
<li>Setup Sikuli properly to include the tesseract libraries. You have a detailed instruction on SikuliX website.</li>
<li>Be aware that OCR feature is rather flaky and usually unreliable unless you do some work on tweaking the OCR engine which outside SikuliX scope.</li>
</ol>

python sikuli