24 April 2013

Get creative with Witness and AppleScript

Witness’ first priority is to alert you when there’s an intruder in your home, and while its setup is simple and it's easy to use, perhaps you still find that something is missing?

With AppleScript it's possible to add an extra bit of functionality to your alarm system, and to make that even easier, we have included a few sample scripts below. You can add these scripts to Witness in the “Actions” tab in the Witness preferences on your Mac (under System Preferences).

Do you already have a great Witness and AppleScript combo set up? Don’t hesitate to share it in the comments!

For those who are just getting started with AppleScript, you’ll find a beginners guide here: http://mac.tutsplus.com/tutorials/automation/the-ultimate-beginners-guide-to-applescript-2/

A script that will play a warning sound (wailing alarm).
This script is ready to use, but you can also adjust it so it plays one of the other sound clips (a barking dog, or how about the one Kevin used in Home Alone?). Or you can use your own sound file. Just make sure the file is in the same folder as the script, and that you replace the name of the file in the script itself, using the AppleScript Editor.

A script that will send an email.
Here you will need to open the script in AppleScript Editor, so you can replace the variables with your own email address.

Other tips, ideas or suggestions? Let us know in the comments below!