We’re not allowed to lock our computers at work and I’m convinced someone checks my Mac when I’m at lunch. Is there any way to secretly capture the screen so I can review what happened at a later date?
That’s very curious that you aren’t allowed to set up any privacy on your computer at work. My guess is that it’s to ensure that everything’s open and available at all times, but since others can get onto your device and mess with things, seems like it’s not a great idea. A much smarter solution is a consistent “guest” account with a simple password, like the name of the company. Then anyone could use any computer as needed and you’d retain your individual privacy for your settings, account, Web sites you visit, documents, etc.
You could also set up your account so that your Documents folder – or even your Desktop – is on a removable USB flash drive or even an external SSD drive, but somehow I suspect that’s frowned upon too. Are you in a secure work setting for some reason?
Turns out you can use a simple command line script from the Terminal app in MacOS X to keep an eye on what’s happening on your computer, though, so let’s talk about that instead. It’s more of a time-lapse solution than a continuous movie, but it’ll definitely give you a sense of whether others are accessing your computer when you aren’t there.
The basic idea is that there’s a command line program called screencapture that lets you grab whatever’s on the main monitor and save it as a PNG image file. By itself that’s done like this:
There’s no output because after a delay of a few seconds it’s grabbed the current screen and saved it as the named file “saved.png”. Here’s what that looks like on my own computer:
To set it up in a loop requires just a little bit of programming: A while loop. To have it run for a set number of captures, taking a screenshot every 30 seconds (that’s 120 images which will take up a lot of disk space, beware!) you could do this:
screencapture -x $secretdir/screen.$count.png
count=$(( $count + 1 ))
In this case we’ll need to set count to 1 to get started, and stopat (stop at) to however many captures you want. For an hour of shots every 30 seconds, that’d be stopat=120. Notice also that we’re not going to save the images in the current directory but use a new subdirectory called “secretdir”. To test it, you can set this to something like “screengrab” but once it’s working, preface it with a ‘.’ and it won’t show up if someone uses the Finder to explore your folders and directories.
So on the very top of this script I’d have the following:
For bonus points the script could check for the existence of the folder and if it isn’t found, create it. That’s surprisingly easy to do in a Mac shell script:
Now test it a few times yourself to ensure that it works, then start the script in the Terminal window like this:
then close the window and leave your computer. Unless they’re really checking out everything you’re doing, odds are very good they’ll never realize you have a script running that’s capturing images every 30 seconds. When you get back, simply use the Terminal window to unhide the directory:
and you can take it from there. Hope that helps you out, but I would also suggest you talk with IT about a more rational privacy and security policy…