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 received theMessage from theBuddy for theChat
                         get attachment theFile
                         tell application "Mail"
                                        set theNewMessage to make new outgoing message with properties {subject:"sometext", content:theMessage, visible:true}
                                        tell theNewMessage
                make new to recipient at end of to recipients with properties {address:"[email protected]"}
                make new attachment with 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!

I did some more reading online and looked for information on iChat as it is apparently very similar to
Messages. I found this on Apple Developer:
https://developer.apple.com/library/mac/#samplecode/iChatAppleScriptSamples/List ings/Add_Incoming_Images_to_iPhoto_Add_incoming_image_to_iPhoto_applescript.html
So I modified the code to this but still no luck:
on received file transfer invitation theFileTransfer
         accept transfer of theFileTransfer
                    tell application "Mail"
                                   set theNewMessage to make new outgoing message with properties
                         {subject:"photo", content:"themessage", visible:true}
                   tell theNewMessage
                           make new to recipient at end of to recipients with properties
                                   {address:"[email protected]"}
                           send
                   end tell
                    end tell
end received file transfer invitation
Also, made sure to have the AppleScript run on Incoming File Transfer in the Messages preferences.

Similar Messages

  • Signature & forwarded messages now showing up as attachments

    Whenever I send an email with attachments, it also changes my email signature and any forwarded messages to attachments. I've tried this in rich-text and plain text format. The only difference is the type of attachment that is sent (HTML vs. TXT).
    This just started about a month ago. Before that everything worked perfectly. This is affecting everyone in my company. We are using Mail on Exchange Server with Snow Leopard. I contact our Exchange administrator, and nothing has changed on their end.
    Any ideas?

    I have a user here at our site that's been experiencing the same issue. He's on 10.6.2, sending to other users on an Exchange 2007 server. Recipients using Mac Mail see his mail as he authored it, with the attachments and forwarded mail text inline. Recipients using Outlook 2007 see non-mail attached content as normal attached files, and any forwarded mail (text?) content as ATT0000x.htm attachments. Not sure when this issue crept up, exactly, but we didn't seem to have a problem until the last couple of months.

  • Forwarded messages accessed by android phone do not include attachments

    I have a Samsung Galaxy S2 and access e-mail thru phone browser.  The forwarded messages do not include attachments. 
    Why is this happenning?
    When I forward messages thru internet browser thru laptop, messages forward attachments fine.

    I am somewhat confused by your title and post. To clarify, is it:
    1. Messages forwarded from your phone do not show attachments when checked from anywhere.
    2. Messages forwarded from your phone do not show attachments when checked from your phone.
    3. Messages forwarded from anywhere do not show attachments when checked from your phone.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • Mime attachments / forwarded messages

    It seems when I receive a forwarded message on any of my mail accounts using my iPhone, all I see is a mime icon that is unable to be clicked. I have checked to see if the message as been downloaded (they are). It appears to happen with aol messages sent.
    Now, when I view the same messages on my macbook pro using Safari, the messages appear as they should. Is there a setting that I have missed?
    Thanks.

    No such missing setting but some email clients when forwarding a received message that was composed in HTML especially, forwards the received message as an attachment instead of a true forwarded message and this can also occur when sending the same type of message via webmail access using a browser depending on the email account provider.
    MIME 1.0 is the industry standard for attachment encoding and decoding and when an email client receives an attachment file type that is not recognized or supported, MIME attachment will be displayed for the attachment instead.
    This seems to be a limitation with the iPhone's email client since I can also read the same type of received message with the Mail.app on my Mac but the root of the problem probably stems from using HTML for message composition which Microsoft wrought upon the internet with Outlook and Outlook Express. If HTML for message composition was no longer supported, the majority if not all problems associated with email exchange would be eliminated and Windows sufferers would improve their swiss cheese for security operating system and MS email clients somewhat.

  • Email attachment not included in forwarded message - no error message given

    A coworker of mine was trying to forward a large 25.6MB pdf over the AT&T network.  She downloaded entire message before hitting forward and selected "include attachments" when given the option.  She could see the icon for the attachment at the bottom of the forwarded message, but the recipient doesn't receive the attachment and it is not reflected in the sent email.  There is no warning or error message given.  She could forward this from her desktop account, so it doesn't seem to be a server based limit on attachments..
    This is an exchange server email account and an iphone 5.
    Any ideas?

    I too am experiencing this behavior, however, for some reason that I do not know, the attachments appear ok one day and then they appear embedded. This is becoming detrimental to my work!
    Is anyone looking into this at Apple?
    C
    --Boundary(IDD652jjiT9bsdspgfbLeNSA)
    Content-type: application/msword; name=vzw-swd-mmsc.doc
    Content-transfer-encoding: BASE64
    Content-disposition: attachment; filename=vzw-swd-mmsc.doc
    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAA
    PAAAAAAAAAAAEAAAPgAAAAEAAAD+////AAAAADsAAAD/////////////////////
    ///////////////////////////////////////////spcEAMyAJBAAA8BK/AAAA
    AAAAEAAAAAAABAAAhCIAAA4AYmpiamSiZKIAAAAAAAAAAAAAAAAAAAAAAAAJBBYA
    An e-mail message with a Word-attachment that was
    sent by forwarding was not interpreted correctly by
    Mail. The attachment is shown as inline undecoded
    data:
    --------------060401070608000609090303
    Content-Type: application/msword;
    name="linuxhandleiding.doc"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
    filename="linuxhandleiding.doc"
    0M8R4KGxGuEA(...)
    To reproduce this, I sent an e-mail with a Word
    attachment to my own address, using Thunderbird on a
    Linux machine. After that, I forwarded the received
    message with the attachment again to my own address.
    In Thunderbird, the forwarded message shows the
    attachment correctly, but in Apple Mail (2.1), that I
    use with the same e-mail account (IMAP), the original
    message shows the attachment correctly, but in the
    forwarded message it appears undecoded in the message
    body (see above).
    I searched the forum and found similar issues, but
    not exactly what happens here. Also, no solutions
    provided helped me to solve this problem. Any
    ideas?
    iBook G4 / Mac
    mini G4   Mac OS X (10.4.7)   Mail
    2.1
    PowerBook G4   Mac OS X (10.4.7)  

  • Can not forward tiff attachments

    Hello All,
    We have a user, using Mac OS X 10.5.4 running Mail.app v3.3. Whenever he attempts to forward a message that contains one or more "tiff" images he gets the following error message in a drop down sheet:
    "The message can't be saved to the OutBox.
    The message contains one or more attachments that are too large to be saved in the Outbox. Try deleting some attachments."
    The same message appears if we attempt to save the message, it just changes from "OutBox to "Drafts mailbox"
    The two tiff images are only 277kb and 142kb respectively, which is not very large at all!
    They can be cut and pasted into a NEW mail message and then sent, but can not be FORWARDED!
    Also, they are stored on the company's Sun IMAP server and not locally on the Mac.
    I've tested and am able to forward messages from his machine that contain several other types of attachments, i.e. PDFs, Word docs, etc...
    Any ideas would be greatly appreciated.

    Yes, yes, HTML messages are irritating but a fact of life, that's beside the point. I find useful ones that I need to forward intact.
    The server in my case is Exchange 2003. I would note that the original message was forwarded to me by someone who I know is running Leopard. So this would seem to be an issue with the message under certain circumstances. If someone at Apple wants a copy of the message, I could send it to them as an attachment.
    Speaking of which, I found a partial workaround to this -- send the whole message as an attachment in another message rather than as a general forward. Works ok, although graphics didn't come through right but the general HTML structure was preserved (when I did it through Entourage).
    -- Alex

  • Forwarding email attachments

    why can't I forward picture attachments that opened fine when I received the email?

    I'm using my local internet provider email. Before getting the MAC, this was never a problem. They are being sent from computer to computer and I really don't know what each of recipients use. It's never been an issue before. When I forward to myself, it doesn't work, which is how I figured out it wasn't working in the first place. Also, when I send an email with an attachment, the finishing message reads, "message sent successfully" with "attachment" When I try to forward, it doesn't even see the attachment. I'm not sure what "redirecting" means...sorry. Thanks for any help you can give. This is getting frustrating.

  • Option to Forward with Attachments

    I used to forward email with the attachments but now it's not working and the option to select "forward with attachments" doesn't come up. Any ideas?

    I would say, anytime programs start to act up on you on the phone...try a true reboot. Normally fixes glitches.
    A reset/reboot is:
    Go to Home Screen
    Press and Hold Home Button
    Keep holding and press and hold Lock Button
    Keep holding Both
    You will see Slide to Turn Off (Don't let go to slide, just keep holding)
    The phone will turn off (in time, but screen will look like it has some white lines)
    Keep Holding
    When you see the Apple Logo, you can let go.
    Turning off via the Slide to Turn off while good and fine to turn off, is more like the Sleep Mode on a computer. Thus any locked up issues in memory remain when you turn back on. A reboot as described is like doing a real Turn off and Turn On on a computer.
    You may also wish to read this tread about reboots and odd application behavior.
    http://discussions.apple.com/message.jspa?messageID=5851978#5851978

  • Attachement in forwarded message

    I cannot see attachments in forwarded messages.. When I scroll down In The message, there is nothing to click on, or open as an attachement whereas the mail it self does contain a message when not opened by the mail app provided on ios7. I do not have this problem if the attachement was not forwarded to me. In that case I can scroll down and see the attachment icon to click on and open my attachement... Does anyone know how to solve this or is it a known problem.?

    Our company is having the same problem, several phones. Is there a solution for this? We have E6 and MS Exchange.

  • Weird text in forwarding message

    Information added that is non relevent to the reciver of a forwarded message.
    For example.
    X-Account-Key: account1
    X-UIDL: 41CAAF885C432D7C65DF69F3D9AE258A
    X-Mozilla-Status: 0001
    X-Mozilla-Status2: 00000000
    X-Mozilla-Keys:
    And alot more
    see image on [IMG]http://i62.tinypic.com/becv9x.jpg[/IMG]

    Thank you that did it.
    Such a simple thing i just could not find.

  • When I forward an email, it includes at the top of the new forwarded message, all the headers from the original message. How do I make that disappear?

    I'm using a Mac Air with Thunderbird 34.0.
    When I forward an email, for some reason it now includes all of the headers at the top of the new forwarded message that I'm creating ... making quite a mess.
    It looks like this below. How do I make it go away?
    -------- Forwarded Message --------
    Return-path: <[email protected]>
    Received: from st11p00mm-smtpin012.mac.com ([17.172.87.212]) by ms03553.mac.com (Oracle Communications Messaging Server 7u4-27.08 (7.0.4.27.7) 64bit (built Aug 22 2013)) with ESMTP id <[email protected]> for [email protected]; Sun, 24 Aug 2014 13:21:27 +0000 (GMT)
    Original-recipient: rfc822;[email protected]
    Received: from mail-qa0-f47.google.com ([209.85.216.47]) by st11p00mm-smtpin012.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPS id <[email protected]> for [email protected] (ORCPT [email protected]); Sun, 24 Aug 2014 13:21:27 +0000 (GMT)
    Received-SPF: pass (st11p00mm-smtpin012.mac.com: domain of [email protected] designates 209.85.216.47 as permitted sender) receiver=st11p00mm-smtpin015.mac.com; client-ip=209.85.216.47; helo=mail-qa0-f47.google.com; [email protected];
    Authentication-results: st11p00mm-smtpin012.mac.com; spf=pass (st11p00mm-smtpin012.mac.com: domain of [email protected] designates 209.85.216.47 as permitted sender) [email protected];
    Received: by mail-qa0-f47.google.com with SMTP id i13so11489430qae.34 for <[email protected]>; Sun, 24 Aug 2014 06:21:24 -0700 (PDT)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:in-reply-to:message-id:date:to :content-transfer-encoding:mime-version; bh=Xfi99wR8Nr2yAuqft1csrVYeP0pN3W6SV6OivQuSeeI=; b=dnVnNnLUPxfe5QnUjmMpyGwjPanqf2bgMW3iTIdtRZTLDS4EKNlVxRXxpHkPgJcSeo WSDgdCAaO6FfKsprrbRLqDsrscX1gPYd0NL/G/cgAlc58noOO7CMkZnLUtIo/GYaoy9I ABk0hcZeJWhJ69j6qNLrX4eQqr/I+jGSbW6vyPmRJ+eNtQ4V5aK7Zhd+jN5y3Ib2AEiC vvbcWHtZPRlLAEKAPcy0QtLaKknePpEu1ebcxG86yyOnIoixFfT1SwFEgjS4ZhAGAFbi EAk//JoMOrGf6+jcLPP079kJD/PYTvx3xjMpSv+0GVlv9uCwieQAYGz0vfu1ro/1Vzsb zp3w==
    X-Received: by 10.140.38.169 with SMTP id t38mr23688513qgt.3.1408886484471; Sun, 24 Aug 2014 06:21:24 -0700 (PDT)
    Return-path: <[email protected]>
    Received: from [192.168.1.100] (static-64-222-96-34.burl.east.myfairpoint.net. [64.222.96.34]) by mx.google.com with ESMTPSA id j65sm44057813qgf.22.2014.08.24.06.21.23 for <[email protected]> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Aug 2014 06:21:23 -0700 (PDT)
    Subject: Re: Morning thoughts
    References: <[email protected]>
    From: Lisa P Kable <[email protected]>
    Content-type: text/plain; charset=us-ascii
    X-Mailer: iPad Mail (11D257)
    In-reply-to: <[email protected]>
    Message-id: <[email protected]>
    Date: Sun, 24 Aug 2014 09:17:34 -0400
    To: Josh Manheimer <[email protected]>
    Content-transfer-encoding: quoted-printable
    MIME-version: 1.0 (1.0)
    Authentication-results: st11p00mm-smtpin012.mac.com; dkim=pass (2048-bit key) header.d=gmail.com [email protected] header.b=dnVnNnLU; dkim-adsp=pass
    x-icloud-spam-score: 33302230 f=gmail.com;e=gmail.com;is=yes;ir=no;pp=ham;spf=pass;dkim=pass;dmarc=?;wl=absent;pwl=absent;clxs=ham;clxl=absent
    x-dmarc-info: pass=?; dmarc-policy=(noPolicy); s=; d=
    X-MANTSH: 1TEIXWV4bG1oaGkdHB0lGUkdDRl5PWBoaHxEKTEMXGx0EGx0YBBIZBBscEBseGh8 aEQpYTRdLEQptfhcHGxEKTFkXGxoaHxEKWU0XZEVeYF9EQREKRFkXGBoRCllJFx0fcRsGGx8ad wYbHBkGGgYaBhMcBhpxGhAadwYaBhsaBhkaBhoGGgYacRoQGncGGhEKWV4XaG55EQpDThdLGxs aYkIfHVIdBE8ZeHMHHWUbGRgbeGYRCkVDFxYcEh9vaxsfHgdsax8aBx4fHmgHa2kaGwceG2xvb xkTGhJpbhxqTUdLQ0YESUVHFBEKWFwXGQQaBBscB01LGkseEhlIBRsdBBsdGAQSGQQbHBAbHho fGxEKXlkXZmYeXlMRCk1cFxsTGREKTFoXaGNrb2sRCkVYF2gRCkxGF2JraxEKQ1oXGBoTBBIfB BgbHAQeHREKQl4XGxEKQkUXbE5JXlATell6cH0RCkJOF2NTY2t7E1h+Gl9eEQpCTBdnSUNncGJ ATk1BeREKQmwXZHNrYAVHZ31uX0IRCkJAF2dFQgVFfEhYaVtuEQpCWBdkcmJzQH5aXX9ZRBEKT V4XBxsRCnBoF2ZZexJuUB0STBlrEQpwaBdpbmEFTx5sYEVwWhEKcGgXbF1uQxNtbgFicngRCnB oF2gbY01wGnxoTWNOEQpwaBdlUkheelweH11gZBEKcGwXa0lCa319GEsaXkIRCnBMF2seXntmH XAFQ3MdEQpwQxdpYE0ZQWtGfH0YQhE=
    X-CLX-Spam: false
    X-CLX-Score: 1005
    X-CLX-Shades: NotJunk
    X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.27,0.0.0000 definitions=2014-08-23_03:2014-08-23,2014-08-23,1970-01-01 signatures=0
    X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1408240172

    From the menu bar select '''View-Headers-Normal'''

  • I want to forward a message with the default headers included, but can't seem to set my mail preferences to include the headers when forwarding, just the original message ends up in the forwarded message and not the headers?

    I want to forward a message with the default headers included, but can’t seem to set my mail preferences to include the headers when forwarding, just the original message ends up in the forwarded message and not the headers?  What I'm trying to do is report SPAM and add headers to a spam message to forward to sites that go after the spammers.

    Did you check the article and the add-on mentioned there?

  • Rule Forwarded Messages are NOT in Sent folder

    I have several rules which filter & automatically forward messages elsewhere. The forward works most of the time BUT it does not appear in my Sent folder. Any insight or help would be appreciated...
    Robyn
    Message was edited by: derryhumma

    Thanks for that hint. Unfortunately I was not so lucky as you were. Also when trashing the .plist only the mac.com account remains in the account list after restart of Apple Mail. All other accounts need to be reinstalled
    Still Mail does not store the mails in the sent folder. Need to say:
    - the "non-storing" is random, not all sent mails are affected. Sometime it is OK, sometimes not
    - Not only the Mac account is affected, it can happen also on my office accounts.
    I am happy for further hints

  • Hi there, When I am forwarding a message in Thunderbird, I get a whole lot of unwanted message data @ the top of each forwarded message. How do I get rid of it?

    I want to be able to forward messages WITHOUT all of this information sitting at the top of each message.
    -------- Original Message --------
    From: - Wed Jul 02 16:02:43 2014
    X-Account-Key: account1
    X-UIDL: GmailId146f53cb7b1eb504
    X-Mozilla-Status: 0011
    X-Mozilla-Status2: 00000000
    X-Mozilla-Keys:
    Delivered-To: [email protected]
    Received: by 10.58.234.98 with SMTP id ud2csp249792vec; Tue, 1 Jul 2014 21:02:16 -0700 (PDT)
    X-Received: by 10.66.226.172 with SMTP id rt12mr1046210pac.101.1404273735957; Tue, 01 Jul 2014 21:02:15 -0700 (PDT)
    Return-Path: <[email protected]>
    Received: from mailak.datacom.co.nz (mx03.datacom.co.nz. [202.175.132.5]) by mx.google.com with ESMTPS id wk8si28988621pab.59.2014.07.01.21.02.14 for <[email protected]> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 21:02:15 -0700 (PDT)
    Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=202.175.132.5;
    Authentication-Results: mx.google.com; spf=neutral (google.com: [email protected] does not designate permitted sender hosts) [email protected]
    Received: from DNZSERVEX1.dnzservices.co.nz (Not Verified[202.175.131.70]) by mailak.datacom.co.nz with ESMTP Gateway id <B53b384440002>; Wed, 02 Jul 2014 16:02:12 +1200
    Received: from DNZSERVEX1.dnzservices.co.nz ([202.175.131.70]) by DNZSERVEX1.dnzservices.co.nz ([202.175.131.70]) with mapi; Wed, 2 Jul 2014 15:59:40 +1200
    From: Canon Orders <[email protected]>
    To: 'Browns Bay Photo & Digital' <[email protected]>
    Date: Wed, 2 Jul 2014 15:59:41 +1200
    Subject: RE: Query | ASAP
    Thread-Topic: Query | ASAP
    Thread-Index: Ac+VqgyW2Vahp62RS86K3r0Ls7Szew==
    Message-ID: <[email protected]es.co.nz>
    Accept-Language: en-US, en-NZ
    Content-Language: en-US
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator:
    acceptlanguage: en-US, en-NZ
    Content-Type: multipart/alternative; boundary="_000_8424F635E837A047A9FEF132ADAF1E070302564B8020DNZSERVEX1d_"
    MIME-Version: 1.0
    Cheers!

    From the Menu Bar select '''View-Headers-Normal'''
    No menu bar? press the alt key.

  • I am unable to forward message in ios8

    I am unable to forward message in ios8.  After updating an iPhone 5s to ios8 I am
    unable to forward messages.  Selecting the more button does not bring up the bottom menu. Any ideas?

    If you have really done that, then the next step is unfortunately a restore:
    Back up and restore your iOS device with iCloud or iTunes
    Use iTunes to restore your iOS device to factory settings
    If you can't update or restore your iPhone, iPad, or iPod touch

Maybe you are looking for

  • REF:SMARTFORM OUTPU TTYPE

    HI ALL, CAN ANYBODY TELL ME WHAT R THE OUTPUT TYPES FOR THESE APPLICATIONS. 1.INVOICE 2.AR MEMO CHARGESHEET 3.PRELIMINARY NOTICE 4.CONDITIONAL WAIVER AND RELEASE UPON PROGRESS PAYMENT. THESE R RELEATED TO FICO. THANKS & REGARDS, PHANI.

  • CiscoView Mail retain voicemails forwarded in Outlook Sent Items....

    All, I know that voicemail messages that are forwarded using the Cisco Viewmail client are actually relayed directly from the Unity Connection server (we are using single inbox) version 8.6.  As a result these messages are not recorded in the message

  • Printing the grid used in creating a PSE 10 drawing

    Hello, I have created a scaled floor plan dwng using the grid in PSE 10. It would be very useful to me to be able to print the grid directly with my drawing - preferably as a semi-opaque 'background'. Can this be done? Thanks, Dan

  • My MacBook Pro crashes when clicking drop down menus online.

    Hi, I have encountered a strange problem in that, on the internet if I click a drop down menu the rainbow spinning wheel comes up and the computer just crashes!! It randomly started happening and now it does it all the time online if I click a drop d

  • Display Info Record: Purch. Organization Data 1

    Hi, Can anyone tell me how to reach this particular screen as I need it Thanx in advance