[Java] Sikuli X: automatically naming screenshots only in Sikuli IDE - not in Java code

Asked by Powers Foss

Hi folks, I recently got Sikuli X 1.0 rc1 working from Java, thanks for your good documentation, RaiMan! Now I'm trying to use a new feature of rc1. The changes for rc1 state, "Screenshot naming - screenshots can be named automatically with timestamps or the text in them as well as manually with prompted filenames." But I don't see anywhere how to do this. Here's my code:

Screen s = new Screen();
ScreenImage si = s.capture();
System.out.println( "Image captured: " + si.getFilename() );

The only problem is that it stores the captured .png file in a /var/folders/.../-Tmp-/ directory that is removed when the test is finished. I have figured out how to copy the file using standard Java File api calls, so I can copy the image to a place and see it when the test is done. I was just wondering how to implement the automatic screenshot naming feature of RC1. Thanks.

Question information

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

this is only a feature of Sikuli IDE.

When using sikuli-script.jar from Java or Jython, your approach is the right one.

Revision history for this message
Powers Foss (powers-foss) said :
#2

Ah, I see. Okay, thanks.