Ms01
Ms01

Reputation: 4702

Using built-in screen capture functions in OSX and receive output?

As most advanced mac users know there is a simple way to take a screenshot. Just using command-shift-4 to take part of a screen as an example. But is there a possibility to use this functionality from say, a python script?

I've seen other threads about taking a screen capture from python (or other languages) but is there any way to use the built in functionality from a script and then use the output as you will?

Upvotes: 0

Views: 688

Answers (1)

Hampus Brynolf
Hampus Brynolf

Reputation: 1336

You can call the terminal command screencapture

This can be invoked from a python script (or other script):

import os;
os.system("screencapture /tmp/test.jpg");
#### do your stuff with the file

Upvotes: 2

Related Questions