Re: Send selected messages as attachments in Mail.app
Re: Send selected messages as attachments in Mail.app
- Subject: Re: Send selected messages as attachments in Mail.app
- From: Justin <email@hidden>
- Date: Fri, 15 Dec 2006 11:56:57 -0800
- Thread-topic: Send selected messages as attachments in Mail.app
Thanks so much for your reply, Jean-Baptiste!
> The following script will take every selected messages and attach
> them to a new mail message
I couldn't get the script below to compile, unfortunately. :( The error I
received was:
Syntax Error: A identifier can't go after this property. [selected messages]
> you can of course replace the use of 'send mail' (this verb comes with the
> XMail osax, http://lestang.org/ osax/XMail) by a piece of script that will
> create a mail message in Mail and then add attachments to it but XMail
> makes things more compact :p
XMail looks like a handy extension, indeed! The only problem with this
approach is that we use authenticated SMTP. While we could embed the user's
name and password into the script, that's less than ideal for security and
ease-of-script-distribution reasons.
That said, I'd be thrilled (for starters) to get your script working. Any
thoughts as to how I might get around the compilation issue mentioned above?
Sincere thanks in advance,
Justin
> From: Le Stang Jean-Baptiste <email@hidden>
> Date: Sat, 9 Dec 2006 10:39:16 +0100
> To: Justin <email@hidden>
> Cc: <email@hidden>
> Subject: Re: Send selected messages as attachments in Mail.app
>
> Hello,
>
> The following script will take every selected messages and attach
> them to a new mail message, you can of course replace the use of
> 'send mail' (this verb comes with the XMail osax, http://lestang.org/
> osax/XMail) by a piece of script that will create a mail message in
> Mail and then add attachments to it but XMail makes things more
> compact :p
>
> set theList to get selected messages of first message viewer
> set theFileList to {}
> repeat with x in theList
> set myFile to (POSIX file (do shell script "mktemp -t mail"))
> set myFileFp to open for access myFile with write permission
> write (get source of x) to myFileFp
> close access myFileFp
> set end of theFileList to myFile
> end repeat
>
> send mail to "email@hidden" from "email@hidden" subject "my test"
> body "my message" attachments theFileList SMTP server "localhost"
>
>
> On Dec 8, 2006, at 4:49 PM, Justin wrote:
>
>> Hi folks!
>>
>> Our mail server has two "spam" and "ham" training email addresses
>> to which
>> mail can be sent as attachments, but that is the only way the
>> training will
>> work -- the entire source of the message must be included as an
>> attached
>> text file to the message (the body/subject/etc of the message
>> itself is
>> ignored). This is great for our Entourage users, as they can simply
>> select
>> multiple messages and use the "Forward as Attachment" option. Our
>> Mail.app
>> users are less fortunate, however; try as I might, I cannot seem to
>> come up
>> with an automated way to forward selected messages as attachments
>> in Apple
>> Mail.
>>
>> My attempts in Automator would come close but were ultimately
>> fruitless. I
>> imagine that this should be possible via AppleScript, but thus far
>> I have
>> been unsuccessful in my attempts. Might anyone out there have any
>> suggestions?
>>
>> Other bits:
>>
>> * The destination email address is fixed.
>> * It would be nice to be able to select multiple messages, right
>> click on
>> the selection, and choose "Forward as Attachment." A keyboard
>> shortcut
>> would do the trick as well.
>>
>> Any pointers or code snippets would be most sincerely appreciated.
>> Thank
>> you! :)
>>
>> Best,
>>
>> Justin
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden