- Code: Select all
---Made by Ian Dopps 2005
---This script will email you 5 iSight pictures that are about 5 seconds apart. It will also send a text message to your phone, telling you to check your email. You can change the number of pictures and time interval if you desire. It will then put the pictures in the trash and close all programs involved so nobody knows. It is great when used with a motion detector trigger in Indigo. Questions? doctorlambo@gmail.com
--- SUBSTITUTE YOUR INFORMATION (NAME) IN 3 PLACES BELOW!
tell application "iChat"
activate
end tell
delay 2
repeat 5 times ---CHANGE THIS NUMBER TO EDIT THE NUMBER OF PICTURES TAKEN
tell application "System Events"
tell process "iChat"
click menu item "Video Preview" of menu "Video" of menu bar item "Video" of menu bar 1
delay 1
click menu item "Take Snapshot" of menu "Video" of menu bar item "Video" of menu bar 1
end tell
end tell
delay 5 ---CHANGE THIS NUMBER TO EDIT THE DELAY BETWEEN PICTURES
end repeat
set mainpath to path to desktop as Unicode text
set need_fold to "iSEEu"
tell application "Finder"
if not (folder (mainpath & need_fold) exists) then
make new folder at mainpath with properties {name:need_fold}
end if
tell application "Finder"
move (every file of desktop whose name contains "Video") to (folder "iSEEu" of desktop)
end tell
end tell
tell application "Mail"
set bodyvar to "Your home security has captured new images. They have been sent to your email inbox."
set addrVar to "3162205537@messaging.sprintpcs.com" ---PHONE ADDRESS HERE. FOR DETAILS, SEE: http://www.livejournal.com/tools/textmessage.bml?mode=details
set subjectvar to "CHECK YOUR EMAIL!"
set newMessage to (a reference to (make new outgoing message))
tell newMessage
make new to recipient at beginning of to recipients with properties {address:addrVar}
set the subject to subjectvar
set the content to bodyvar
end tell
send newMessage
end tell
tell application "Mail"
set bodyvar to "Here is the photo taken when your motion detector was set off:"
set addrVar to "doctorlbo@gmail.com" ---EMAIL ADDRESS HERE
set subjectvar to "Motion Detector Set Off"
set attachmentVar to "/Users/dopps/Desktop/iSEEu" ---CHANGE FILE NAME HERE (THE USER NAME SHOULD BE THE ONLY DIFFERENT THING)
set newMessage to (a reference to (make new outgoing message))
tell newMessage
make new to recipient at beginning of to recipients with properties {address:addrVar}
set the subject to subjectvar
set the content to bodyvar
tell content
make new attachment with properties {file name:attachmentVar}
end tell
end tell
send newMessage
end tell
delay 2
tell application "Finder"
delete folder "iSEEu"
end tell
tell application "iChat"
close window "My iSight"
quit "ichat"
end tell
tell application "Mail"
delay 45 ---GIVE IT AT LEAST 6 SECONDS PER PICTURE TAKEN TO LOAD AS AN ATTACHMENT. OTHERWISE, IT MAY CLOSE MAIL BEFORE IT IS DONE LOADING THE ATTACHMENTS. SO, IF YOU HAVE 3 PICS TAKEN, PUT 18 OR MORE IN PLACE OF THE NUMBER 45 YOU SEE HERE.
quit "mail"
end tell