Adding attachments into front outgoing message of Apple Mail.app

Joined
Feb 28, 2018
Messages
1
Reaction score
0
Points
1
Hi ALL,

I want to add attachments into mail compose window of Apple Mail.app. If compose window is already open, then i want to add attachments into existing draft window / outgoing message window.

Code:
set newMessage to (a reference to (make new outgoing message))
tell newMessage
tell content
                repeat with theItem in argv
                    set filename to theItem as POSIX file
                    make new attachment ¬
                        with properties {file name:filename} ¬
                        at after the last word of the last paragraph
                end repeat
            end tell
            set visible to true
         end tell

The above code snippet always opens a new mail compose window and add attachments into that window. How do I add attachments into existing outgoing message window?


Thanks!!!
 
Last edited by a moderator:

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top