Scripting Bridge and multiple attachments
Scripting Bridge and multiple attachments
- Subject: Scripting Bridge and multiple attachments
- From: Israel Chauca Fuentes <email@hidden>
- Date: Mon, 31 Aug 2009 11:49:43 -0500
Hi there!
I'm using scripting bridge to send emails with Mail.app and I have
managed to do so, but I still have a little problem.
When adding attachments, the first one is placed at the beginning of
the message, while the rest of them are placed at the end of the
message, which is certainly odd. I would like to place all attachments
at the end of the message, which is how I use to place them by hand,
but I don't know how.
The code that adds the attachments is the following:
_______________
for ( NSString* path in [self.attachments componentsSeparatedByString:
@"\n"] ) {
/* add an attachment, if one was specified */
if ( [path length] > 0 ) {
/* create an attachment object */
MailAttachment *theAttachment = [[[mail
classForScriptingClass:@"attachment"] alloc] initWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys: path, @"fileName", nil]];
/* add it to the list of attachments */
[[emailMessage.content attachments] addObject: theAttachment];
}
}
_______________
Thanks!
Israel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden