GetFileName() returns a .png file name but the actual file does not exist

Asked by simon

Hi All

Totally new to Sikuli so please excuse the question if it has been covered already (i have checked and I dont think it has). My scenario is as follows on Windows XP:

Created a java project in Eclipse and added sikuli-script.jar to the build path. I created two Screen objects as I have a dual monitor setup
Screen a = new Screen(0);
Screen b = new Screen(1);

I then wish to capture on screen "a" with the following (i require the entire screen):
ScreenImage ImageOne = a.capture();

When checking the filename with:
String ImageNameOne = ImageOne.getFilename();
System.out.println(ImageOne.getFilename());

I do get a path to the image but I cannot see the file. This is the result that I get from the Console in Eclipse:
Number of Screens:2
Bounds of Screen a: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
Bounds of Screen b: java.awt.Rectangle[x=-1440,y=0,width=1440,height=900]
C:\DOCUME~1\simon\LOCALS~1\Temp\sikuli-scr-7455254049188650240.png
C:\DOCUME~1\simon\LOCALS~1\Temp\sikuli-scr-2705325177027668341.png

So in summary the two png files above do not exist and was wondering what I could be doing wrong. From what I understand currently Sikuli is not able to save the image files to a customized folder and so I would like to then create the image and then copy the file to a specified location but I cannot get Sikuli to create the file.

Thanks in advance
Simon

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

It seems, that these "temporary" image files only exist during the exisitence of the process.

somehow pause your test (e.g. use popup) and have a look at your personal temp folder - they should be there.

So just take the returned filename and copy the files to another place - should work.

Revision history for this message
simon (simonk) said :
#2

Thanks RaiMan, that solved my question.