Skip to content

ciuliene/pyScreenshots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyScreenshots

Test codecov

This script allows you to take screenshots of your active applications and save them in a folder.

Operating systems

The scripts has been tested on macOS only. I cannot guarantee that it will work on other operating systems.

Requirements

  • Python 3.6+

Install the required packages (virtual environment is recommended):

pip install -r requirements.txt

Usage

Arguments:

Take a screenshot of an application. Available options:

Flag Type Description Required Default Errors
-l, --list bool Get the list of active applications - -
-la, --list-all bool Get the list of active applications with geometries - -
If --list is not provided:
-n, --name str Application name None Whether application is not open
-i, --index int Application index None Whether index is out of range
-d, --destination str Destination folder 'screenshots' (subfolder in current folder) None
-ew, --expected-width int Expected width of the screenshot Current width Whether negative or zero
-eh, --expected-height int Expected height of the screenshot Current height Wheter negative or zero
-r, --repeat int Number of screenshots to take 1 None

Examples:

Get the list of active applications (the name is used with the -n argument, the index is used with the -i argument):

python main.py -l

Get the list of active applications with geometries (the name is used with the -n argument, the index is used with the -i argument)::

python main.py -la

Take a screenshot of the application (selected by index) and save it in the "screenshots" folder:

python main.py -i <app_index>

Take a screenshot of the provided application name (if it is active) and save it in the "screenshots" folder:

python main.py -n <app_name>

Take 5 screenshots of the provided application name (if it is active) and save them in the "/Users/screenshots" folder (will be created if it does not exist). To take the next one press Enter

python main.py -n <app_name> -d "/Users/screenshots" -r 5

Take a screenshot of the provided application name (if it is active) and save it in the "screenshots" folder. The width of the screenshot will be 1920px (height will be adjusted to keep the aspect ratio)

python main.py -n <app_name> -ew 1920

Take a screenshot of the provided application name (if it is active) and save it in the "screenshots" folder. The size of the screenshot will be 1920x1080 pixels.

python main.py -n <app_name> -ew 1920 -eh 1080

About

Take screenshots of open applications using Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages