View unanswered posts | View active topics It is currently Sun May 19, 2013 8:31 pm



Reply to topic  [ 6 posts ] 
 Email Photo? 
Author Message

Joined: Nov 26, 2009
Posts: 923
Location: Kalispell, MT
Post Email Photo?
Hey,

I use CamSpinner to capture my webcam images, works pretty well, and was
hoping there might be some way to email the images?

If not it might be nice to add an "attach file" to the email action.

Trying something like this. It sends the email but no attachment:
Code: Select all
tell application "Mail"
   set bodyvar to "Here is the photo taken with the living room camera:"
   set addrVar to "ckeyes@xxxx.net" ---EMAIL ADDRESS HERE
   set subjectvar to "Living Room Webcam Image"
   set attachmentVar to "/Users/TV/Applications/CamSpinner/WebCam Data Files/webcam1.jpg" ---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


Thanks,

Carl


Wed May 30, 2012 3:40 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Email Photo?
The script works fine for me...

We've already got a request to add attachments so we'll look at it again when working on future releases.

_________________
Jay (Indigo Support)
Image


Wed May 30, 2012 5:21 pm
Profile WWW

Joined: May 25, 2009
Posts: 95
Post Re: Email Photo?
You can use a shell script with something like mutt from macports (http://www.macports.org)
Take a look at this example page.
http://www.shelldorado.com/articles/mai ... ments.html


Wed May 30, 2012 6:38 pm
Profile

Joined: Nov 26, 2009
Posts: 923
Location: Kalispell, MT
Post Re: Email Photo?
Thanks, maybe path to the webcam1.jpg file
is the problem? Does it look right to you?

Carl


Wed May 30, 2012 6:51 pm
Profile

Joined: Nov 26, 2009
Posts: 923
Location: Kalispell, MT
Post Re: Email Photo?
Got it. It was a path problem.

Thanks again,

Carl


Wed May 30, 2012 7:08 pm
Profile

Joined: Nov 26, 2009
Posts: 923
Location: Kalispell, MT
Post Re: Email Photo?
Just in case someone may have a need, this script will send a file to multiple recipients.

Code: Select all
tell application "Mail"
   set addressList to {"ckeyes@xxxx.net", "lola@xxxx.com"}
   set nameList to {"Carl", "Lola"}
   set bodyvar to "Here is the photo taken with the living room camera."
   set subjectvar to "Living Room Webcam Image"
   set attachmentVar to "/Applications/CamSpinner/WebCam Data Files/webcam1.jpg" ---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
      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 addressList}
      end repeat
      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


Carl


Thu May 31, 2012 5:54 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.