Jump to content


Photo

WANTED: Advanced Screen Capture Script


  • Please log in to reply
6 replies to this topic

#1 Hackmonkey

Hackmonkey
  • Members
  • 5 posts

Posted 22 June 2012 - 07:46 PM

Greetings,
I did a search for existing scripts but the few I found did not meet my needs. I did come across one that seemed to fit 90% of my needs but the code was very complex and did not compile. My skillz were not up to the challenge of sorting out the issue so looking for some advice.

Long story short, because of those dudes sarbanes and oxley, I have to maintain a crap ton of screen captures and documentation when performing build at my job. The task is pretty tedious and takes away from the job at hand.

SUMMARY
As I configure our application, make changes, and/or create new records I must capture screen shots. If Editing records I accompanied with DETAILS such as RECORD NAME, RECORD ID, and small DESCRIPTION. The details can either be captured as a text HEADER in a WORD or EXCEL above the pasted screen capture -OR- the details can be part of the image, ie like how you can add text into a windows PAINT image.

NEED
So as you can imagine, stopping at each step of build to take a print screen, editing in PAINT, pasting in EXCEL, adding text details for each step is very tedious and does not allow for critical thinking or focusing on the build portion of your job. So I am looking to create or find a script that can help me automate this process.

Ideally, it would be a floating semi transparent tool bar that when invoked would allow me to capture a selected portion of the active screen, Change the size of the captured image to a predefined Height and Width, prompt me for a prompt for details, save to clipboard (or save as individual files), allow this to happen for multiple captures, then when done, recall/compile data and allow me to past into a single document like EXCEL or WORD.

This can be done as I go or get all images from clipboard and be done post. That is, using the script at each capture point or use the script when done after all images are captured.

REQUIREMENTS
Capture screen image from active window
Auto resize image to specified size
prompt for:
FILE NAME
FILE ID
DETAILS
Take details from prompt and add to image -OR- save for final paste to external document as header


WANTS
Ability to compile all of this into external document automatically

Its a large amount I know. Hoping there is something out there that is close to this that I can modify.

Thank you in advance

#2 girlgamer

girlgamer
  • Moderators
  • 2039 posts

Posted 22 June 2012 - 08:05 PM

I'm not generally one to recommend specific pieces of software but you might find what you need if you look up MWSnap through a Google search. Try the Mirek site it appears to be the most uptodate and reliable http://www.mirekw.co...are/mwsnap.html

#3 Hackmonkey

Hackmonkey
  • Members
  • 5 posts

Posted 22 June 2012 - 08:18 PM

I will check it out. Looking for a flexible solution regardless of the source. I appreciate your time. Thanks

#4 Hackmonkey

Hackmonkey
  • Members
  • 5 posts

Posted 22 June 2012 - 08:39 PM

MWSnap provides some basic controls but lacks the customization I need for capturing details for each image that is needed to automate my process. Looking at Snagit too which also has lots of settings but still lacking the data portion. Wondering if I can utilize one of these applications for the screen capture portion and create or find a script that leverages the images from clipboard.

any thoughts on that

#5 Relayer

Relayer
  • Members
  • 104 posts

Posted 22 June 2012 - 09:03 PM

Try this for starters. You will need the Gdip library by Tic for this to work.

Relayer


#SingleInstance Force
#NoEnv

Gui, Add, Edit, w300 vName, Name
Gui, Add, Edit, w300 vDetails, Details
Gui, Add, Button, gGo, Go
Gui, Show
Return

Go:
Gui, Submit
GuiControlGet, name,, Name
GuiControlGet, details,, Details
Msgbox, % name
Msgbox, % details


FileAppend, %Details%, %A_ScriptDir%\%name%.txt
CaptureActiveWin(A_ScriptDir . "\" . name . ".png")

Cancel:
ExitApp

Escape::ExitApp


CaptureActiveWin(saveAs="")
{
	WinGetActiveStats, Title, Width, Height, X, Y
	Area := X . "|" . Y . "|" . Width . "|" . Height 

	if (saveAs = "")
	{
		FileSelectFile, saveAs, 48, %A_ScriptDir%\*.png, Name the image file, Image files (*.png; *.bmp)
		if (ErrorLevel) || (saveAs = "")
			Return False
	}
	pToken := Gdip_Startup()
	Gdip_SaveBitmapToFile(pBitmap := Gdip_BitmapFromScreen(Area), saveAs)
	Gdip_DisposeImage(pBitmap) 
	Gdip_Shutdown(pToken)
	Return
}


#6 girlgamer

girlgamer
  • Moderators
  • 2039 posts

Posted 22 June 2012 - 09:11 PM

It should be possible to use AutoHotkey to run a specific Capture function like MWSnap or SnagIt and then post-process the image with the data you need. The reason I suggested MWSnap was not because it was a complete solution to what you said earlier but because it has the ability to stay resident and allow you to capture multiple images. Ultimately you will probably need to combine an AutoHotkey script with one or more other utilities to achieve what you seek. Perhaps one to grab, one to scale, one to process the text with the image, etc AutoHotkey does have the ability to manage more than one application at a time if you need it to. You could, for example, grab the item with MWSnap, and then open Wordpad to create the text you need, save the snap and the text to a specific directory then combine the two in some appropriate fashion. In the end the job rests entirely on your ability to integrate the separate tools you choose into one functioning system.

#7 Xx7

Xx7
  • Members
  • 616 posts

Posted 24 June 2012 - 04:00 PM

Hi Hackmonkey,

Are you familiar with the "Screen Clipping" tool that is built into Excel 2010? It's the icon that looks like a camera.

I placed it on the Quick Access Toolbar in the second position... so it can be accessed with the keyboard shortcut ALT+2
Posted Image

Here's my code using the Screen Clipping tool
!h::

;########### GUI ##################
Gui, Add, Text,, File Name:
Gui, Add, Text,, File ID:
Gui, Add, Text,, Details:
Gui, Add, Edit, vFileName ym
Gui, Add, Edit, vFileID
Gui, Add, Edit, vDetails
Gui, Add, Button, default, OK  
Gui, Show,, Input information
return 
;########################################

GuiClose:
ButtonOK:
Gui, Submit

;############ Enter info into Excel ############
XL := ComObjCreate("Excel.Application"), XL.Visible := True, XL.Workbooks.Add

XL.Range("A1").Value := "FILE NAME:"
XL.Range("A2").Value := "FILE ID:"
XL.Range("A3").Value := "DETAILS:"

XL.Range("C1").Value := FileName
XL.Range("C2").Value := FileID
XL.Range("C3").Value := Details

XL.Range("A6").Select ;place screen capture image starting in A6
;########################################

Sleep, 1000

;The following code will be SPECIFIC to your Excel setup
;I placed the "Screen Clipping" item on the Quick Access Toolbar
;It's the second item on it, so you can activate it by ALT+2

Send, {alt}
Sleep, 200
Send, 2
;########################################

ExitApp
GUI
Posted Image

Final output
Posted Image