• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding attachments into front outgoing message of Apple Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding attachments into front outgoing message of Apple Mail.app


  • Subject: Re: Adding attachments into front outgoing message of Apple Mail.app
  • From: 2551phil <email@hidden>
  • Date: Mon, 26 Mar 2018 21:02:57 +0700

Something like this:

tell application "Mail"
        set _mailMessage to make new outgoing message with properties
{sender:"your name <email@hidden>", subject:subj, content:messageText}
        tell _mailMessage
                make new to recipient at end of to recipients with properties
{address:addr_of_recipient}
                try
                        make new attachment with properties {file name:my
theAttachment} at after the last paragraph
                end try
                delay 2
                send
        end tell
end tell



Best

Phil
@sqwarq


> On 28 Feb 2018, at 21:45, Maju M <email@hidden> wrote:
>
> 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.
>
> 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!!!
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Can someone please confirm this....
  • Next by Date: CalendarLib question
  • Previous by thread: Re: Adding attachments into front outgoing message of Apple Mail.app
  • Next by thread: CalendarLib question
  • Index(es):
    • Date
    • Thread