Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 07-19-2012, 04:43 PM   #1
hsthompson
Prospect
 
Join Date: Mar 2008
Posts: 24
Screencapture Command and Multiple Monitors

I need to totally automate a screencapture command for each screen attached to a Mac Pro, running either Snow Leopard or Lion. This would happen hourly, saving each file to the Sites directory, for viewing online (e.g. MONITOR1 -> ~/Sites/monitor1.png, MONITOR2 -> ~/Sites/monitor2.png).

This is literally the task, so I can't unfortunately include human intervention/interaction in the process.

I know how to write the script to do most of this, except I don't know how to specify a monitor, or otherwise get an image of every attached screen.

Can the monitor by specified in the command? Can I tell it to capture all screens to separate files?

Thanks.
hsthompson is offline   Reply With Quote
Old 07-19-2012, 08:29 PM   #2
ganbustein
MVP
 
Join Date: Apr 2008
Location: Berkeley CA USA
Posts: 1,016
I gather that you've already looked at man screencapture, which admits right up front that the command is not very well documented. It does mention that it takes as arguments a list of files to write the screen images to, one per monitor.

I can only surmise that you simply provide as many filenames as you have monitors. You probably already know how many monitors you have; if not you can query the output from system_profiler, as in:

system_profiler SPDisplaysDataType | grep "Online: Yes" | wc -l

Unfortunately, I have only one monitor, and can't test what happens with multiple monitors. If you only want some of the monitors captured, you may have to just capture them all and then throw away the ones you don't want.


You're opening a huge security hole when you do this. There's no telling what sensitive information will get captured by screencapture, and you're blabbing it to the entire web over Web Sharing. Do not imagine for a moment that "no one will look because no one will know to look." That's what's known as "security through obscurity", a stratagem that has been repeatedly demonstrated to be woefully inadequate.
ganbustein is offline   Reply With Quote
Old 07-20-2012, 02:25 AM   #3
benwiggy
League Commissioner
 
Join Date: Aug 2006
Posts: 5,071
Quote:
Originally Posted by ganbustein
I can only surmise that you simply provide as many filenames as you have monitors.

Yes, this works for dual monitors.
benwiggy is offline   Reply With Quote
Old 07-23-2012, 01:50 PM   #4
hsthompson
Prospect
 
Join Date: Mar 2008
Posts: 24
Thanks, ganbustein!

Security isn't a consideration in this case.
hsthompson is offline   Reply With Quote
Old 07-23-2012, 03:34 PM   #5
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,560
Quote:
Security isn't a consideration in this case.

Those are famous last words. Security is always a consideration unless your computer is on display in the cellar with the lights gone out, the stairs gone out, in the bottom of a locked filing cabinet stuck in a disused lavoratory with a sign on the door saying "Beware of The Leopard". (my apologies to the spirit of Douglas Adams)

Trevor
trevor is offline   Reply With Quote
Old 07-23-2012, 07:25 PM   #6
hsthompson
Prospect
 
Join Date: Mar 2008
Posts: 24
We don't always have the luxury of dictating these things, trevor. I have to deal with the questions that arrive at my desk, even if they're usually the wrong ones. I do my best, but this place is as sophisticated as Diebold.

C'est la vie, unfortunately.
hsthompson is offline   Reply With Quote
Old 07-23-2012, 08:57 PM   #7
ganbustein
MVP
 
Join Date: Apr 2008
Location: Berkeley CA USA
Posts: 1,016
Then get a liability waiver signed by the guy who stamped "Security is not a consideration" on the question that fell on your desk. Make it as scary sounding as you can, but make it very clear that security consequences are present, that he has been so advised, and that when the **** hits the fan he's volunteered to have it all land on him.

CYA, man. CYA!
ganbustein is offline   Reply With Quote
Reply

Tags
automation, bash, screencapture, terminal

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 01:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.