Can sikuli capture screenshots and save them as files?

Asked by 谢宝良

Can sikuli capture screenshots and save them as files?

Can sikuli still select regional screenshots?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1
Revision history for this message
谢宝良 (xiebaolianger) said :
#2

Thank you for friends upstairs.
But it does not seem to be able to specify a save path

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

please read again carefully:

capture(region | text, [path, ]name)
only available in Python scripting

Parameters:
| text (region) – an existing region object or text to display in the interactive mode.
path – a path to a folder where the image is stored
text – name of the image file (.png can be omitted)
Returns:
the absolute path of the stored image as path/name.png or None if no success
Works principally the same as the normal capture, but directly stores the resulting image to the specified location. The ``name``spec need not have the .png ending.

If the path specification is omitted, the imagefile is stored in the current bundlepath. In this case the imagename will finally be bundlepath/_name.png, where the leading underscore is an IDE convention to block the deletion of images, that are not namely referenced somewhere in the script, at the time the script is saved in the IDE.

Can you help with this problem?

Provide an answer of your own, or ask 谢宝良 for more information if necessary.

To post a message you must log in.