AutomationBox Tools - make a free macro to take screenshots

Are you documenting a program or new functionality, writing an article or collecting material for a presentation? If yes, you probably have to insert a lot of graphics into the text, and for the most part, various screenshots.

If the amount of work is small, the efforts you make to capture screenshots are not significant. But if you have to make more than 3-5 pictures, it makes sense to make things easier.

Let's see how AutomationBox Tools free automation utulities can be used to automate the process of taking screenshots of windows, their parts or arbitrary control elements.

How many actions are you repeat each time you take a screenshot?

First, let's find out what actions you repeat each time you make a screenshot:

  1. Make a screen copy using the PrtScr (the entire screen) or Alt+PrtScr (active window) keys
  2. Insert the image into the graphic editor
  3. Cut the unnecessary areas of the image
  4. Save the picture into a file. The filename usually includes the name of the window or control element, which is captured in the image

AutomationBox Tools free automation utilities automate this steps

Now let's see how AutomationBox Tools can be used to automate these steps.

To select windows and control elements, you can use the abtcapture utilitity with the --manualselect parameter. It is also can determine name, position and size of the selected objects.

To create screenshots, you can use the abtscrshot utility, also a part of AutomationBox Tools.

All we have to do is to combine them in such a way that after the object is selected, its name, size and position were passed to abtscrshot as the filename and screen area.

Since AutomationBox Tools work from command line, they can be easily combined. In this particular case, let's use the abtcapture --execute parameter, which allows running an arbitrary command after the object is selected.

Information about the selected object can be passed using the environment variables ABT_* (the full list is given in the "Environment variables" chapter).

To make a loop, we write a simple command file (.cmd).

The created screenshots will be saved in the screenshots subdirectory.


mkdir screenshots 
abtcapture --manualselect --execute^
 "abtscrshot '.\screenshots\%%ABT_FRIENDLYNAME%%.png' --area %%ABT_SCREENRECT%%"
if %ERRORLEVEL% equ 0 goto GO

Some comments

The first line creates the screenshots directory.

The second line contain a conditional branch label, to which we will return after the screenshot is successfully created.

The third line contains a call to abtcapture --manualselect to select the object in the screen.

The --execute parameter specifies that after the object is selected, the abtscrshot command will be launched with the composite object name passed as the filename parameter (it automatically substitutes for %%ABT_FRIENDLYNAME%% before launching abtscrshot).

The last line checks the execution result and if all went well (the return code = 0), proceeds to the GO label.

That's all.

Now simply launch scrshot.cmd and you will only have to point the mouse to the necessary object and press Ctrl to create a screenshot or Esc to stop "photographing". The created screenshots will be automatically placed tot he screenshots directory.


Bookmark & Share


Subscribe to Blog

AutomationBox Blog



View all


MouseRobot is VERY interesting program. I have had a few important & time consuming tasks and now MouseRobot does them for me! Thank you AutomationBox!
Neeraj Bhatnagar, software engineer

This is what I have been looking for. It greatly helps automate multiple mouse-and-keyboard procedures I have to go through day in and day out. My life has improved greatly by such a wonderful program.
Artur Beltz



November 11, 2010
New Feedback System


October 16, 2010
MouseRobot 2.0 released!

Download Now!


June 24, 2010

MouseRobot 2.0
(beta-version) available


June 21, 2010

Site design changed!


News Archive >>