← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #222923]: Using Sikuli to take automated screenshots of a window?

 

Question #222923 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/222923

    Status: Open => Answered

RaiMan proposed the following answer:
type("4", KeyModifier.CMD+KeyModifier.SHIFT)

But since you are already in Sikuli, that is making Screenshots all the
time ;-)

import shutil
import os
screenshotsDir = "absolute-path-to-a-folder"
img = capture(some_region)
shutil.move(img, os.path.join(screenshotsDir, "some-name.png")

where some_region is
some_region = SCREEN # for whole screen
or
someRegion = App.focusedWindow() # for the frontmost window

This has the advantage, that you can control the file name of the shot.

Will be a compound feature in the upcoming new version.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.