Screenshot script

  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Posts: 6809
  • Loc: Martinsburg, WV

Post 3+ Months Ago

I was wondering if there was a way to setup a script to take screenshots at specific intervals throughout the day and then save them to a file share based off the HOSTNAME of the PC.

For example the script would take a screen shot at 8AM, 12PM, and 4PM and upload each screen shot to a folder on a file server \\fileserver\hostname\date

The times would need to be easily editable and would be super sweet for the script to create the directories if they don't exist. This script would probably end up running on easily 100 PCs.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Many years back I had wrote a script to do this on a Linux base box, but I believe it required all sorts of OS specific commands for the script to load up the browser and then take portions of the screen as a screenshot. What operating system are you wanting to do this on? Windows? I will look around later to see if I can dig up this script I had wrote. Maybe it will be able to help you.
  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Posts: 6809
  • Loc: Martinsburg, WV

Post 3+ Months Ago

This is a Windows environment, it would need to be compatible with XP and 7. Basically what we are trying to accomplish is grabbing some screenshots of an application that is running in fullscreen mode. So the screenshot would be a simple prtscrn basically, I'm not looking to grab just a portion, the whole dang thing.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I looked into it further and found my script. Basically I was using a small library called URLShot:

Quote:
URLshot is a PERL hack. It uses the X Virtual FrameBuffer server (Xvfb) and a browser (currently skipstone, because it's tiny and needs minimal user intervention) to grab screenshots of web sites. These are then reduced to thumbnail size and postprocessed for sharpness. The PerlMagick package (a set of Perl bindings for ImageMagick) is used to this effect.


Unfortunately it does not look like this was made for Windows at all.

I looked into ImageMagick a bit more, hopefully you have heard of that. Usually people use that to do all sorts of image manipulation from the command line or scripts. It looks like the import command line tool allows you capture some or all of the screen:

Quote:
Use the import program to capture some or all of an X server screen and save the image to a file. See Command Line Processing for advice on how to structure your import command or see below for example usages of the command.


So an example command you could use to take a screenshot of your entire screen could be:

Code: [ Select ]
import -window root screenshot.jpg


You could easily run this command from some sort of script you write, you just need to have ImageMagick installed and probably Cygwin/X. Here are the uses for Cygwin/X:

Quote:
One use for Cygwin/X is to provide a graphical interface for applications running on the same computer with Cygwin/X which are designed for the X Window System. Such an application is probably running under Cygwin.

Another use for Cygwin/X is as an X terminal: applications running on another computer access the Cygwin/X X server via the X protocol over an IP network. One can run XDM on the remote system so that a user can log in to the remote computer via a window on the Cygwin/X system and then the remote system puts up web browsers, terminal windows, and the like on the Cygwin/X display.

Another common way for an application on a remote system to operate through a window on a local Cygwin/X display is SSH tunneling. An application on the local system creates an SSH session on the remote system (perhaps the application is xterm and the user types an 'ssh' command). The SSH server on the remote system sets things up so that any X client program the shell starts (on the remote system) uses the local Cygwin/X server


So with Cygwin/X, ImageMagick, and some sort of custom script you write to interface with those, I believe you could do what you want.

Hopefully that gets you going on the right track.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 119 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.