Click to viewYou just shelled out a bucketful of clams for your new MacBook and you want to protect your investment. What if a sticky-fingered thief eyes your hot new lappie at the coffee shop? It's easy to add a security system to your MacBook that'll help you ID would-be robbers.
With freeware app iAlertU and some Applescript magic, your MacBook can snag a photo of the thieving scoundrel and upload it to your FTP server automatically. Here's how.
Mac only: iAlertU is a very cool alarm system for the MacBook Pro.
NOTE: iAlertU requires an iSight camera and the motion sensing features built in to Apple's MacBooks and MacBook Pros, so you'd need one of those two computers for this to work correctly. Also, keep in mind that this method is far from foolproof. This won't necessarily save your Mac from being stolen, but hey - it's cool, and it certainly *could* help get your stolen Mac back.
If you've got Transmit (a Mac FTP app that we simply love here at LH headquarters), open it up. If you don't have it, well, you might want to consider getting it.
The first thing you want to do is set up a favorite in Transmit. To do so, go to the Favorites tab and hit the plus sign (+) to add a new favorite. Enter your FTP info and you're good to go.
Next, go to the Transfers tab of the Transmit preferences. Where it says "When an item already exists...", change the Uploading files option to "Replace the existing file". This isn't necessary, so if you don't want to overwrite files by default, don't change this setting. You just want to make sure that when it matters, your image capture will be uploaded to the FTP server.
Download the iAlertU FTP script, open the file, and edit the settings to match your settings. It's simple enough - where it says your_name, put your username, and where it says Your Transmit Favorite, enter the favorite we set up above. There is probably a much better way to do this, but I don't know it. Place the script in this directory: /Library/Scripts/Folder Action Scripts.
Turn on Folder actions (if they're not already enabled). To do so, go to Applications -> Applescript -> Folder Actions Setup, and click the checkbox labeled Enable Folder Actions.
Next, click on the plus sign (+) to add the to-be-monitored folder, in this case your home folder.
Now click the plus sign (+) on the script side. You should see a menu listing several Folder Actions scripts, including the script you just downloaded. Double click the iAlertU FTP script.
The last thing you need to do is create a folder in your home directory called alert. This will come in handy for the next section.
You're all set. Now, as soon as iAlertU's alarm goes off, it'll snap a picture. The picture will go into your home folder, which will fire off the Applescript, uploading the image to your FTP server. When the image is uploaded, it is moved to the alert folder so that we know it was uploaded successfully. To give you an idea of the amount of time this takes, from alarm to completed upload normally takes about 15 seconds (in the video it only took around 12), which is pretty good.
However, if the thief gets you computer turned off before the upload can complete, this script won't work. That's why we head to the second tier of the iAlert FTP upload.
The next Applescript will check the home folder for the iAlertU picture on startup, and, if it's there, upload it to the server. This way, even if the thief gets your computer home, you've still got a good chance of getting the iAlertU picture as long as he connects to the internet eventually.
Download the Upload image on startup script.
Again, open the Applescript file and edit the config section to match your settings.
After you've set up the Applescript, you need to save it as an application. Go to File -> Save as..., change the File Format to application, and uncheck the Startup Screen option. Click save.
Finally, go to your Accounts settings in the preferences. In the Login Items tab, add your new upload image on startup.app to the list of startup items.
Now, if the iAlertU image was not uploaded the first (or subsequent times), it will continue to try and upload the image every time the computer starts up until it's successful. When it is successful, the image will be moved to the alert folder and the Applescript will no longer attempt to upload it to the server.
This method could definitely be tweaked if anyone out there knows more than me and feels like putting in the time, but as-is it's a pretty good method for bolstering, if not your theft protection, your vigilante justice prospects.
Got any good theft-proofing ideas/methods of your own (even if they're, "don't leave your computer alone")? Let's hear them in the comments.
Adam Pash is an associate editor for Lifehacker who works hard to get a glimpse at the face of evil. His special feature Hack Attack appears every Tuesday on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.