Unable to use 'capture()' function if Sikulix-IDE is not running

Asked by aidma

When I try to use the 'capture()' keyword outside of the Sikulix-IDE I get the following error:

>>> print capture(Region(0, 0, 50, 50))
java.io.FileNotFoundException: C:\Users\aidma\AppData\Local\Temp\Sikulix\sikuliximage-1429193157686.png (The system cannot find the path specified)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
        at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:69)
        at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:55)
        at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:419)
        at javax.imageio.ImageIO.write(ImageIO.java:1530)
        at org.sikuli.basics.FileManager.saveTimedImage(FileManager.java:526)
        at org.sikuli.script.ScreenImage.save(ScreenImage.java:91)
        at org.sikuli.script.ScreenImage.getFile(ScreenImage.java:78)
        at org.sikuli.script.ScreenImage.getFilename(ScreenImage.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
        at org.python.core.PyObject.__call__(PyObject.java:461)
        at org.python.core.PyObject.__call__(PyObject.java:465)
        at org.python.core.PyMethod.__call__(PyMethod.java:126)
        at sikuli.Sikuli$py.capture$24(C:\SikuliX\sikulixapi.jar\Lib\sikuli\Sikuli.py:324)
        at sikuli.Sikuli$py.call_function(C:\SikuliX\sikulixapi.jar\Lib\sikuli\Sikuli.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:167)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:307)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:131)
        at org.python.core.PyFunction.__call__(PyFunction.java:413)
        at org.python.pycode._pyx149.f$0(<stdin>:1)
        at org.python.pycode._pyx149.call_function(<stdin>)
        at org.python.core.PyTableCode.call(PyTableCode.java:167)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.Py.runCode(Py.java:1374)
        at org.python.core.Py.exec(Py.java:1418)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:279)
        at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:131)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:116)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:62)
        at org.python.util.InteractiveConsole.push(InteractiveConsole.java:165)
        at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:146)
        at org.python.util.jython.run(jython.java:396)
        at org.python.util.jython.main(jython.java:145)

I think the problem is that the "\Sikulix\" folder is not being created.

Using 'capture()' in the Sikulix-IDE works. And, while the IDE is running, I can see that the "\Sikulix\" folder exists. Additionally, 'capture()' works from external Jython scripts *so long as* the IDE is running.

But once I close the IDE, "\Sikulix\" gets deleted, and 'capture()' ceases to work from external scripts.

SYSTEM INFO:
- Using Windows Server 2012 R2
- Using Sikuli Nightly from: sikulixsetup-1.1.0-20150415.231201-39-forsetup.jar

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

made it a bug.

is fixed 2015-04-18+

Revision history for this message
aidma (aidan-mahler13) said :
#2

Thanks RaiMan, that solved my question.