Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript Forward Messages Attachments

Hello,


I'm trying to make it so that any iMessages including picture/video attachments I receive get forwarded to my e-mail address. I created a script that runs on the "message received" event from the iMessages preferences. It worked fine for just text, but cant seem to get the video/picture out of the message.


using terms from application "Messages"

on message receivedtheMessagefromtheBuddyfortheChat

get attachmenttheFile

tell application "Mail"

set theNewMessage to makenewoutgoing messagewith properties {subject:"sometext", content:theMessage, visible:true}

tell theNewMessage

makenewto recipientat end of to recipientswith properties {address:"myemail@gmail.com"}

makenewattachmentwith properties {file name:theFile}

send

end tell

end tell

end message received

end using terms from


As I expected I get an error that "theFile" is undefined or whatever, meaning that get attachment had no effect. For now lets assume every message received will always contain a picture and some text.


Any help would be greatly appreciated!

MacBook Air, OS X Mountain Lion (10.8.4)

Posted on Aug 10, 2013 8:39 PM

Reply

There are no replies.

AppleScript Forward Messages Attachments

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.