.text() returns blank when no monitor connected

Asked by Seyed Mohammad Hossein Amirkhalili on 2019-02-09

I have a PC that does not have a monitor and I connect to it and use it via remote controlling applications such as team viewer. When I am running a simple script like:
r = (a region on screen)
a = r.text()

it returns blank.

I have tried the very same code on the very same situation on my laptop and it works perfectly fine and returns the text. So my question is is not having a monitor affecting .text() and OCR behavior? if yes, is there any workaround for this?

Question information

Language:
English Edit question
Status:
Open
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
5 hours ago
Last reply:

1.1.4-SNAPSHOT-#207-2019-02-22_16:20/Windows10.0/Java8(64)1.8.0_201-b09

This is the error I get

[error] script [ Untitled ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\ADMINI~1\AppData\Local\Temp\2\Sikulix_1223329205\sikuli-5132171255533210720.py", line 2, in <module> b = a.text() File "C:\Users\Administrator\AppData\Roaming\Sikulix\Lib\sikuli\Region.py", line 53, in text return JRegion.text(self).encode("utf8")
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:288)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
at com.sun.jna.Native.register(Native.java:1647)
at com.sun.jna.Native.register(Native.java:1360)
at net.sourceforge.tess4j.TessAPI1.<clinit>(TessAPI1.java:41)
at org.sikuli.script.TextRecognizer.start(TextRecognizer.java:92)
at org.sikuli.script.TextRecognizer.doOCR(TextRecognizer.java:243)
at org.sikuli.script.TextRecognizer.doOCR(TextRecognizer.java:238)
at org.sikuli.script.Region.text(Region.java:4866)
at org.python.p

roxies.sikuli.Region$Region$5.super__text(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: The specified module could not be found.

This happening on a remote server computer without physical monitor connected to it. I connect it via Windows remote desktop connection client

So the first time I run the code I got that error and then second time its just blank no report no log no error. as if code does nothing!

Can you help with this problem?

Provide an answer of your own, or ask Seyed Mohammad Hossein Amirkhalili for more information if necessary.

To post a message you must log in.