tell application "Finder"
activate
if file "Macintosh HD:Users:macmini:Desktop:SecuritySpyimage.jpg" exists then
delete file "Macintosh HD:Users:macmini:Desktop:SecuritySpyimage.jpg"
end if
delay 5
end tell
tell application "SecuritySpy"
capture image camera number 13 as "/Users/macmini/Desktop/SecuritySpyimage.jpg"
end tell
set theSubject to "Front Porch Sensor Detection"
set theSender to “myname@aol”.com
set theAddress to “xxx@hotmail.com”
set theAttachment to "/Users/macmini/Desktop/SecuritySpyimage.jpg"
tell application "Mail"
set theMessage to make new outgoing message with properties {subject:theSubject, sender:theSender}
tell theMessage
set visible to false
make new to recipient at end of to recipients with properties {address:theAddress}
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
send theMessage
delay 10
end tell
tell application "System Events"
set visible of process "Mail" to false
end tell
set sourceFolder to "Macintosh HD:Users:TV:Sites:ss1"
script o
property l : {}
end script
tell application "Finder"
set o's l to sort (every file of entire contents of folder sourceFolder) by modification date
repeat with i from (count o's l) to 1 by -1
if name of item i of o's l is not ".DS_Store" then
set theVideo to (item i of o's l as alias)
end if
end repeat
end tell
tell application "IndigoServer"
set theInsert to "This attached video was taken at " & value of variable "ClockTimeAmPm" & " with your couch camera." & return & return & "Have a good " & value of variable "TimeOfDayShort" & "!"
set PrintDateTimeName to value of variable "DayDate"
end tell
set theSenderTemp to "xxx@xxxxxx.com"
set the_mailto to {"xxx@xxxxxx.net"}
set nameList to {"Carl"}
set TheName to "Couch Webcam Video"
set the_subject to "Alert! Motion Detected From Couch Camera."
set the_content to ("Hey Carl," & return & return & "This is an automated message from your Indigo Security System." & return & return & theInsert & return & return & "To report a problem with your system contact " & theSenderTemp & "." & return & return & "Your image from, " & TheName as text) & ", from the folder " & PrintDateTimeName & " has been backed up into the folder Security Cameras." & return & return
tell application "Mail"
activate
set attachmentVar to theVideo
set newMessage to make new outgoing message with properties {address:the_mailto, subject:the_subject, content:the_content}
tell newMessage
set x to offset of "Indigo Security System." in the_content
repeat with y from 0 to count of "Indigo Security System."
set font of character (x + y) of content to "Helvetica Bold"
set color of character (x + y) of content to {48632, 1630, 1102}
end repeat
set x to offset of TheName in the_content
repeat with y from 0 to count of TheName
set font of character (x + y) of content to "Helvetica Bold"
end repeat
set x to offset of PrintDateTimeName in the_content
repeat with y from 0 to count of PrintDateTimeName
set font of character (x + y) of content to "Helvetica Bold"
end repeat
set x to offset of "Security Cameras." in the_content
repeat with y from 0 to count of "Security Cameras."
set font of character (x + y) of content to "Helvetica Bold"
set size of content to (17)
end repeat
make new attachment with properties {file name:attachmentVar}
repeat with i from 1 to count nameList
make new to recipient at end of to recipients with properties {name:item i of nameList, address:item i of the_mailto}
end repeat
send
end tell
end tell
Users browsing this forum: No registered users and 5 guests