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.

scrshot.cmd:


mkdir screenshots 
:GO 
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

Share/Bookmark

Subscribe to Blog

AutomationBox Blog

  Testimonials

 

View all

 

I love MouseRobot! An actual macro style recorder that operates by function rather than by cursor location. This is way easier to use and understand than any other macro program.
Aitken Rendell, technical support consultant

I am web developer and typically I have a lot of programs open. With MouseRobot I can run the single script, and a few seconds later my work area is ready to go! This is amazing!
Phill Judd, web developer

  News

 

November 11, 2010
New Feedback System

 

October 16, 2010
MouseRobot 2.0 released!

Information
Download Now!

 

June 24, 2010

MouseRobot 2.0
(beta-version) available

 

June 21, 2010

Site design changed!

 

News Archive >>