Home Alarm System Applescripts

Post Your Setup, Automated Actions, and Results!

So Far, This Thread Contains WORKING and TESTED Home Alarm System Automated Actions of:

On Motion and/or Sound Detection:
-Auto Facetime Call (& FullScreen)
-Auto Email/Airmail Image/VideoClip
-Auto iMessage (needs a tester) Image/VideoClip

Working on:
-Device Proximity (Bluetooth/Wifi) Alarm Activation

So, You have a Multiple Self Managed Home-Alarm Systems on your Hackintosh with Motion Detection & Facial Recognition that Auto-Activates / Locks when you leave the Proximity of the Alarm System. We are going to use Evological’s EvoCam. Why? There are others, but they are not as unrestrictive.

What are some Alarm System Features, Automated Actions and Devices would you use? Any computer action? Action from a Bluetooth device?

  • Remote Viewing Password Encrypted w/ a Log of the Viewers
  • Works with 1080p Wireless Night Vision IP Cameras w/ Audio
  • Remotely Pan Tilt and Zoom Cameras (Night Vision, Wireless, Indoor, Outdoor, WaterProof)
  • Auto-Uploaded to Multiple Encrypted Clouds and Servers
  • Emergency Backup Electricity / Wi-Fi / Flood Lights / Audio Output / Bluetooth
  • Physical Computer Lock Down http://www.computersecurity.com/laptop/stop-lock_b.htm / Hidden. http://www.computersecurity.com/laptop/stop-lock_b.htm
  • Network Security - (Secure Router, Firewalls, Anti-Virus/Malware Protection, etc…)
  • IOS (IPhone/IPad) Push Notifications (When Activated / Deactivated or when Motion/Sound Sensed)
  • Infrared Motion Detection (Bluetooth)
  • Window and Door Sensors
  • Laser trip Sensors
  • Air Quality and Gas Sensors
  • Conducted Electrical Protected Areas Items
  • Bright Lights
  • Loud Alarms
  • Shortcuts for Notifying Your Homies/Neighbors
  • Shortcut Controller or App for implementing added scripts (functions)
  • Play Pre-Recorded Video On Screen (After attempted FT Calls)
  • Play Computer Voice from your Voice, Transcribed, While Your Watching the Live Stream and Controlling Scripts from an Iphone/IPad/Android (free) App along with your encrypted self-managed system.

Theft Recovery for Computers/Devices

There should rly be a Blog/Forum specifically for Alarm System Automations and Setup Competitions.

Submit Your Ideas and Setup:


You can put this into safari’s address bar:
facetime://appleid
facetime://email@address
facetime://phone#

It will open up facetime, but the problem is that it won’t auto-call.

Solution: If you run this code in “AppleScript Editor”, it opens a dialog that has the default number in it.

But, I don’t need the dialog box, tho kinda cool.

Can anyone pleaaase fix this code?

THANK YOU

property defaultCall : "PUT THE DEFAULT FACETIME NUMBER / EMAIL HERE"

set userInput to display dialog "QuickFaceCall version 0.9.8 Beta" & return & return & "Enter the iPhone number, email address, or AppleID of the person you want to Facetime:" default answer defaultCall buttons {"Cancel", "Call"} default button 2

set ft to text returned of userInput

if the button returned of userInput is "Call" then
tell application "System Events"
open location "facetime:" & ft
-- start AUTO CALL
-- comment the following lines out if you do NOT want AUTO CALL
activate application "FaceTime"
do shell script "sleep 1"
activate application "FaceTime"
keystroke return
-- end AUTO CALL
end tell
end if

end

 

How i plan to use this applescript:

I have home alarm system with motion detection. I wish to auto facetime call my phone when it detects motion.

These two Mac/Iphone apps support applescript functions:

Orbicule Witness: http://www.orbicule.com/witness
Evological Evocam 5 http://www.evological.com/evocam.html

Side note: My Facetime account name won’t call with same account for some reason. I can call my phone from my mac, but not from my phone to my mac.

What are some other applescripts for a home alarm system could you think of?

Works perfectly (Without dialog):

property defaultCall : "PUT THE DEFAULT FACETIME NUMBER / EMAIL HERE"

tell application "System Events"
   open location "facetime:" & defaultCall
   do shell script "sleep 3"
   tell application process "FaceTime"
      click button "Call" of front window
   end tell
end tell

Mirror Forum Post: http://www.codez4mac.com/forum/viewtopic.php?f=289&t=76837&p=916270#p916270

So, I think the these may be the most useful apps to use alongside some of the automated actions.

ControlPlane supports multiple contexts where a context is defined as a location or activity you are performing. Using evidence sources you can create a set of rules that tell ControlPlane what context to apply to your environment. When ControlPlane enters or leaves a context a set of Actions are performed.
http://www.controlplaneapp.com/feature-list/

Proximity Runs Scripts on Your Mac When Bluetooth Devices Are Near or Far
https://code.google.com/p/reduxcomputing-proximity

ControlPlane seems to do what Proximity does and much more.

With Evocam (the most advanced home security app i found), this is the way i found it may be possible to:

  • Auto-Facetime Call on motion detection (w/ full screen activation)

With this code:


property defaultCall : "PUT ICLOUD OR PHONE #"
tell application "System Events"
   open location "facetime:" & defaultCall
   do shell script "sleep 3"
   tell application process "FaceTime"
      click button "Call" of front window
      click button "full screen" of front window
   end tell
end tell

So that this is deactivated and does not detect motion and call me while I am home:

In Evocam, Using “When document is online/offline” in the " Online State section.

I would need to write a script that makes an Evocam file go online/offline (Cmd-L in Evocam). Can Somebody Make This Please?

Then, trigger this action (With ControlPlane or Proximity when my Phone comes within or leaves the Proximity via Bluetooth/Wi-Fi.

Does anyone have the ability to write this script and to write this script.
There should be a few similar scripts that should come from something like that.

Need more ideas on other things to automate tho.

Related Links:

Applescript Resources:
http://www.macosxautomation.com/applescript/resources.html
http://www.macosxtips.co.uk/index_files/category-applescript.php

Home Automation Software

When using the ControlPlane or Proximity apps, I can set it to enact these scripts to activate or deactivate the alarm system.

Go Online

tell application "EvoCam"
   tell document "ScrumpSurveillance"
      set online to true
   end tell
end tell

Go Offline

tell application "EvoCam"
   tell document "ScrumpSurveillance"
      set online to false
   end tell
end tell

I know these apps can call the above scripts when a specific bluetooth becomes discoverable. Which i need help figuring out.

But, Is there a way to call these scripts when an iphone joins a wifi network, or comes within range? This would be preferable option.

Any help? thx

http://www.controlplaneapp.com/feature-list/
https://code.google.com/p/reduxcomputing-proximity

Also, Can anyone test these scripts to Send IMessages?

tell application "Messages"
        send "test message" to buddy "appleid" of service "E:yourappleid"
    end tell

    tell application "Messages"
        send file "volume:folder:file.ext" to buddy "appleid" of service "E:yourappleid"
    end tell

note: ‘appleid’ is the address you want to send to and ˜yourappleid’ is your address.

Related Articles:
https://discussions.apple.com/thread/4322806
https://www.mikesel.info/send-an-imessa … plescript/
http://www.littlebluemonkey.com/blog/ap … tification

IMessage is incompatible w/ Hackintosh (Unibeast/Clover) right now, so i can’t test the scripts.

THX

So, I need to set a “Watch Folder” to enact the Above action (to send an iMessage) and the below action (to send an email). With the items being put in to this “Watched Folder”.

AppleScripts to Send Emails:

Create a message with Attachment in Airmail:

tell application "Airmail"
	activate
	set theMessage to make new outgoing message with properties {subject:"the subject", content:"the content"}
	tell theMessage
		set sender to "youraccount@example.com"
		set signature to "My signature"
		make new to recipient at end of to recipients with properties {name:"John", address:"to@example.com"}
		make new cc recipient at end of cc recipients with properties {name:"Lara", address:"cc@example.com"}
		make new bcc recipient at end of bcc recipients with properties {name:"Mark", address:"bbc@example.com"}
		make new mail attachment with properties {filename:"path:path:Downloads:foto.JPG" as alias}
		sendmessage 
	end tell
end tell

Code taken (and edited) from here: http://support.airmailapp.com/post/95590186378/airmail-apple-script

Still working on the way to create a message with Attachment in Mac’s Mail App (but, not personally needed):

Watch Folder/Auto-Email Scripts and Related Articles:

-Files Mailed Magically When Dropped in a Finder Folder:
http://murphymac.com/files-mailed-magically-when-dropped-in-a-finder-folder/
-Setting up a watch folder:
http://fetchsoftworks.com/fetch/help/Contents/Tutorial/SettingUpWatchFolder.html
-Becoming More Efficient through Folder Watching:
http://www.mactech.com/articles/mactech/Vol.20/20.07/FolderWatching/index.html
-Apple Script Email when new file added to drive:
http://stackoverflow.com/questions/26600381/apple-script-email-when-new-file-added-to-drive
-Sending emails with attachments through AppleScript:
http://stackoverflow.com/questions/10063266/sending-emails-with-attachments-through-applescript
-Automator Actions:
http://automator.us/downloads.html

This may also be convenient to have in this situation:
-[REQ] Ultimate Productivity Automator Action Pack:
http://www.codez4mac.com/forum/viewtopic.php?f=328&t=28296

I definitely need some help with this part. Anybody? All or most of the answers are definitely there in those links.

Thank You

Watch-Folder Auto-Mail File

on adding folder items to thefolder after receiving theAddedItems
	
	repeat with eachitem in theAddedItems
		
		set theSender to "Put Your Email Here"
		set recipSubject to "Put Your Subject Here"
		set recipName to "Put Recipent Name Here"
		set recipAddress to "Put Recipent Address Here"
		set msgText to "Put Message Text Here"
		
		tell application "Mail"
			
			set newmessage to make new outgoing message with properties {subject:recipSubject, content:msgText & return & return}
			tell newmessage
				set visible to true
				set sender to theSender
				
				make new to recipient with properties {name:recipName, address:recipAddress}
				make new attachment with properties {file name:eachitem} at after the last paragraph
				
				
			end tell
			send newmessage
		end tell
		
		
	end repeat
	
end adding folder items to

Watch-Folder Auto-Airmail File

on adding folder items to thefolder after receiving theAddedItems
	repeat with eachitem in theAddedItems
		
		set theSender to "Put Your Email Here"
		set msgSubject to "Put Your Email Subject Here"
		set recipAddress to "Put Recipnt Email Here"
		set recipName to "Put Recipent Name Here"
		set msgText to "Put Message Text Here"
		
		tell application "Airmail 2"
			activate
			set theMessage to make new outgoing message with properties {subject:recipCommon, content:msgText}
			tell theMessage
				set sender to theSender
				make new to recipient at end of to recipients with properties {name:recipName, address:recipAddress}
				make new cc recipient at end of cc recipients with properties {name:recipName, address:recipAddress}
				make new bcc recipient at end of bcc recipients with properties {name:recipName, address:recipAddress}
				make new mail attachment with properties {filename:eachitem as alias}
				sendmessage
			end tell
		end tell
		
	end repeat
end adding folder items to

These codes were taken and edited from only these two sources:
http://murphymac.com/files-mailed-magically-when-dropped-in-a-finder-folder/
http://support.airmailapp.com/post/95590186378/airmail-apple-script

To Get This Working:
Place This Script in This Folder: “/Library/Scripts/Folder Action Scripts”
Right-Click on the Folder Your Watching > Services > Folder Action Setup…
Then Select The Above Script

Both Tested. I will add “Watch-Folder Send File in iMessage” and the Combined Versions when i have it tested. Somebody test the iMessage script from above. Hackintosh… Have No iMessage THX