• 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
Scripting Bridge and multiple attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Scripting Bridge and multiple attachments
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: New Developer Docs for Cocoa and QTKit Developers with Snow Leopard Release
  • Next by Date: Re: What sound plays after an Installer runs?
  • Previous by thread: Re: New Developer Docs for Cocoa and QTKit Developers with Snow Leopard Release
  • Next by thread: Re: Scripting Bridge and multiple attachments
  • Index(es):
    • Date
    • Thread