unable to save script after removing images from the .sikuli folder

Asked by Simon K

Hi,

I've created a script which will rely entirely on the image library(a folder with all the images) specified via addImagePath. Currently it looks like this:

addImagePath("C:\\ImageLibrary\\8900\\")

Once I've removed the existing screenshots from the folder and moved them to the new image path folder (with sikuli IDE turned off), I've restarted sikuli and got the following errors:

Exception in thread "main" java.lang.NullPointerException
 at org.sikuli.ide.ImageButton.createFromString(ImageButton.java:241)
 at org.sikuli.ide.SikuliPane.replaceWithImage(SikuliPane.java:617)
 at org.sikuli.ide.SikuliPane.parseLine(SikuliPane.java:568)
 at org.sikuli.ide.SikuliPane.parseRange(SikuliPane.java:528)
 at org.sikuli.ide.SikuliPane.parse(SikuliPane.java:543)
 at org.sikuli.ide.SikuliPane.parse(SikuliPane.java:546)
 at org.sikuli.ide.SikuliPane.read(SikuliPane.java:427)
 at org.sikuli.ide.SikuliPane.loadFile(SikuliPane.java:372)
 at org.sikuli.ide.SikuliIDE.loadFile(SikuliIDE.java:838)
 at org.sikuli.ide.SikuliIDE.restoreSession(SikuliIDE.java:768)
 at org.sikuli.ide.SikuliIDE.(SikuliIDE.java:713)
 at org.sikuli.ide.SikuliIDE.getInstance(SikuliIDE.java:138)
 at org.sikuli.ide.SikuliIDE.main(SikuliIDE.java:973)

Which, i assume, means that it can't find the screenshots.

In that case, how do i go about referencing the images in my script? Currently I'm using the following syntax:

click("8900_downloads_folder.png")

as I assumed that the location will be appended to that, so the compete location would be:

C:\\ImageLibrary\\8900\\8900_downloads_folder.png

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
j (j-the-k) said :
#1

As fas as I know, the Sikuli IDE does not support image references from outside the .sikuli folder. Note, that the IDE does often replace absolute path names with the image names (without telling the user). After my experience with the IDE, I would not recommend using it with sikuli-file-external images.

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

@ j
His intention is totally correct - the problem is the way he did it

@ Simon
You may leave the images now where you have moved them.
But the next time you do something like this:
- save the script with the images in place
- close the tab with the script (so it is not session-remembered)
- stop IDE
- move images from the .sikuli to the place you need
- open IDE again
- open your script again (no image thumbnails will be shown)
- modify the script (addImagePath ...)
- save the script
- run the script

Now that you have moved the images away, while the script was still open, the only chance:
delete the registry key according to faq 2005.

Revision history for this message
j (j-the-k) said :
#3

Okay, sorry, I guess I didn't read it through. RaiMan is right.

Revision history for this message
Simon K (szymonkaz) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
Simon K (szymonkaz) said :
#5

Cheers for the quick support!