loading
Picture of Laptop Recovery
So recently I got a last generation powerbook, my first laptop. Even though I back up my data, I would still rather not have it stolen. Or, if it gets stolen, I'd like to be able to get it back. After looking online for a free solution, I found LoJack for Laptops. Sounds like it would work, but you have to pay a subscription. I don't want to have to pay money to have a 3 in 4 chance (straight from the website) of getting my laptop back if it's stolen! So I rolled my own using python and an ftp server. The program starts running in the background every time you log in, and every two minutes it checks with an ftp server to see if I've flagged it as stolen. If I have, it takes a screenshot and uploads it with the current IP address and a timestamp to the server, and keeps doing it every two minutes until I have it stop. While it won't do remote data deletion, it could pretty easily - I just didn't want to risk accidentally triggering it while testing.
 
Remove these adsRemove these ads by Signing Up

Step 1: Requirements

Picture of Requirements
To make your own copy of the script, you'll need the following:
1. An apple computer running a fairly recent version of OS X

2. Apple developer tools - these are necessary to compile the script into an application that can start running every time you log in. The mac-development only package is fine. Be warned, this is a pretty big download, but it's definitely worth it if you are interested in coding anything on a mac ever.

3. An apple ID - it lets you register and download the developer tools above.

4. Python - it comes pre-installed with the computer

5. Access to an FTP server - it doesn't have to be yours, but you do need the username, password, and address of a server with ftp access.

6. An empty text file called 'yes.rtf' - keep this somewhere on your computer but don't upload it to the server yet
 

Step 2: Getting the script

Picture of Getting the script
You won't need to create the script yourself, but you will need to edit the one attached. Up at the top where it has the variables:

serveraddress
username
password
path_to_screenshots
time_between_screenshots

fill in your information and desired time in seconds (although I would just leave it at two minutes). This is what the program uses to log into your FTP server and check if you want to upload any pictures, and if so, to upload the screenshots.

Step 3: Creating the Application

Picture of Creating the Application
Picture 1.png
Once you've finished editing the python script save it and then close xcode. On your desktop, right click or control click the script (ScreenshotTaker.py) and under "Open With >" choose "Build Applet". An app called ScreenshotTaker should appear in the next couple of seconds on your desktop. This is the final app that we're going to have launch at startup.  

Step 4: Automatically Running the Program

Picture of Automatically Running the Program
syspref.tiff
dragitin.tiff
Picture 2.png
Alright, so at this point you should have a ScreenshotTaker application as well as a ScreenshotTaker.py file on your desktop. If you'd like to delete the ScreenshotTaker.py file you may, it won't be a problem unless your FTP server changes. To get the script running every time you login:

1. Open up system preferences, under the apple logo way in the upper left corner of your screen

2. Click on Accounts

3. Move ScreenshotTaker somewhere it won't be so easy to find - like your utilities folder (/Applications/Utilities)

3. Click on the Login Items tab and drag ScreenshotTaker (the app) onto the list

4. Make sure to check the box making it hidden

Bam, you're done. Anytime you want to start taking pictures of your laptop's screen, drag that 'yes.rtf' file onto the server. Make sure that there isn't already one there if you don't want to take screenshots. Once the 'yes.rtf' text file is dragged into your ftp's main directory (/) screenshots will be taken every two minutes and named like so:

IP Address_Year_Month_Day_Hour_Minute.jpg

To stop taking screenshots, delete the 'yes.rtf' file from your ftp directory.

Only thing that would make this better is if it uploaded an image from a webcam as well
Scytheon35 years ago
Do you know if there is any way to do this on windows. I already have and ftp server but dont know how to do the equivalent of the python script on windows
thedownsmeister (author)  Scytheon35 years ago
 Hey scytheon-
There is a way to do it on a windows, but it's slightly more complicated. Python does work on windows, you just have to install it first (I'm not sure if it comes pre-installed). Anyway, once you've installed it, the script should work fine, but it's harder to get it to run automatically in the background. You could look into cron and automated task scheduling - I tried to do it with the osx equivalent but my computer was not cooperating. Let me know how it turns out
ill try it out and thanks for getting back to me so quickly
thedownsmeister (author)  Scytheon35 years ago
 No problem. One more thing, though - in the script, I use the os module (os.system, specifically) to run a command as if I was running it from the terminal, basically. But the screenshot command I used does not exist on windows. Apparently, there is no standard screen capture command in the windows terminal, but you might try installing ScreenKap and seeing if that works. Also, you'll have to change the path to the screenshots - I'm not sure what it is on windows. I hope this helps - if you get it working please let me know!