Windows: Sikuli works until file is saved -- do not save to c:\ - use a directory

Asked by T.K. Little

Dear Sir / Madam,

Although Sikuli usually works fine, it now has totally stopped working. Everything works fine when I write codes in an empty file in the Sikuli application, but when I save it (it doesn't matter if I name it 'Untitled' or 'Test script' or anything) it doesn't work any more. Imediately after pressing the save button and saving has done, I try to run this script again, but now it returns a Syntax error.
For example:

I write the following code in a new document inside the Sikuli application:

from org.sikuli.script.natives import Vision

Vision.setParameter("MinTargetSize", 1) # A small value such as 6 makes the matching algorithm be faster.

click("1341908177583.png")
click("Qpcncn.png")

Now lets try to save it as Test.sikuli in the root directory C:\.

When I now try to run the script from the Sikuli application (as I succesfully did before saving it) it returns the following error on line 1:
SyntaxError: ('mismatched character \'\\n\' expecting \'"\'', ('', 1, 17, 'addModPath("C:\\")\n'))
In other cases it returns almost the same error but then it says instead of ' expecting \'"\'' ' in that case ' expecting COLON " '.

The strange thing is, it doesn't matter what I write in the script, it keeps returning this error since I saved it. Even when I delete everything I wrote and replace it with just one simple line like 'popup("Test","Test")' I get the same error.
So, before saving everyting went fine, after saving nothing works. Do you have any idea how to solve this? Your help would be greatly appreciated, because right now I can't start Sikuli to run anything.

I look forward to your answer,

With kind regards,

Mr. T.K. Little

Question information

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

Known problem.

Scripts cannot reside at c:\

must at least be one folder level, e.g.

c:\myScripts\

Revision history for this message
T.K. Little (new-forest) said :
#2

O.K. I just solved it. I used a apostrophe (this mark: ' ) in the path to the file. This confuses the program and returns an error. After restarting the program and saving the file by using a valid path (without apostrophe) everything works again.