Multiple Screenshot Export

Asked by David Hynes

Hi, I'm brand new to this, and I was hoping ya'll could help me.

I'm trying to automate taking multiple screenshots (500+) and exporting them into a folder. (Later to be turned into a PDF)

More specifically, in between each screenshot, the mouse will move the browser to another screen (back/forward, I got that part down, simple "click(selected back-arrow)").

I've read the answer to question 176302, but my coding skills are lacking.

I've been using the "Capture" tool, but those images do not seem to be saved anywhere that I can export them to.

I've been using the IDE, and maybe that was my problem?

Thanks so much,
-David

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

import shutil
import os
num = 0 # to create some file name
dir = "some-path-where-you-want-to-have-the-images"
image = capture(some_region) # which might be SCREEN
# image now is an image file in temp
shutil.move(image, os.path.join(dir, "image%d.png"%(num)))
this moves the current image as "image0.png" to your dir
num += 1

only an example to show the principle -you might have other ideas how to form your filenames

Can you help with this problem?

Provide an answer of your own, or ask David Hynes for more information if necessary.

To post a message you must log in.