10.7.5 Applescript Error

Posted on
Sat Sep 09, 2017 7:47 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

10.7.5 Applescript Error

Finally moved up a notch to 10.7.5 from 10.6.8 to get Indigo 7 happening but am finding some errors
in my dreaded Applescripts. I have no idea how to convert a script like this to Python so for the moment
if someone might have a fix I'd sure appreciate it.

Thanks,

Carl

The error is:
Mail got an error: Can’t make {address:{"ckeyes@cxxxx.net"}, subject:"Alert! Motion Detected From Bunkhouse Camera.", content:"Hey Carl,....

Code: Select all
tell application "SecuritySpy"
   capture image camera number 2 as "/Users/TV/Sites/ss/2.jpg" with overwrite
end tell

tell application "IndigoServer"
   set theInsert to "This attached image was taken at " & value of variable "ClockTimeAmPm" & " with your bunkhouse camera." & return & return & "Have a terrific " & value of variable "TimeOfDayShort" & "!"
   set PrintDateTimeName to value of variable "DayDate"
end tell

set theSenderTemp to "info@whitefishhomesolutions.com"
set the_mailto to {"ckeyes@xxxxx.net"}
set nameList to {"Carl"}

set TheName to "Bunkhouse Webcam"

set the_subject to "Alert! Motion Detected From Bunkhouse 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 "/Users/TV/Sites/ss/2.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

Posted on
Mon Sep 11, 2017 6:25 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: 10.7.5 Applescript Error

Hi Carl,

It looks like setting the message recipient is now more complicated. Change this line:

Code: Select all
   set newMessage to make new outgoing message with properties {address:the_mailto, subject:the_subject, content:the_content}

to:

Code: Select all
   set newMessage to make new outgoing message with properties {subject:the_subject, content:the_content}

And inside the "tell newMessage" block add this line:

Code: Select all
      make new to recipient at end of to recipients with properties {name:the_mailto}

Image

Posted on
Mon Sep 11, 2017 5:41 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: 10.7.5 Applescript Error

As always, you're amazing...works great.

Many thanks,

Carl

Posted on
Wed Sep 13, 2017 3:37 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: 10.7.5 Applescript Error

One other question...Are you aware of any AppleScript issues going from 10.7,5 to 10.8?

Many thanks,

Carl

Posted on
Thu Sep 14, 2017 1:04 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: 10.7.5 Applescript Error

Not that I recall hearing of.

Image

Posted on
Thu Sep 14, 2017 1:14 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: 10.7.5 Applescript Error

Thanks...fingers crossed.

Carl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests