Hey,
Been experimenting with this for hours but am getting nowhere.
This script works fine in 10.5.8 but errors out in 10.8.
What it does is capture a webcam image and send it to address contained
in a variable in Indigo, my automation app.
tell application "SecuritySpy"
capture image camera number 0 as "/Users/1.jpg" with overwrite
end tell
tell application "IndigoServer"
set theInsert to "This attached image was taken at " & value of variable "ClockTimeAmPm" & " with your front camera." & return & return & "Have a terrific " & value of variable "TimeOfDayShort" & "!"
set PrintDateTimeName to value of variable "DayDate"
set the_mailto to "{" & (ASCII character 34) & value of variable "CamMailAddress" & (ASCII character 34) & "}"
end tell
set theSenderTemp to "info@xxxxx.com"
--set the_mailto to {"ckeyes@xxxxx.com"}
set nameList to {"Customer"}
set TheName to "Front Webcam"
set the_subject to "Alert! Motion Detected From Front Camera."
set the_content to ("Hey," & 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 "/Users/TV/Sites/ss/1.jpg"
set attachmentVar to "/Users/1.jpg"
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
Here is the error.
Really appreciate any insight on why it errors out in 10.8.
Thanks,
Carl