• 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 & Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Bridge & Mail


  • Subject: Scripting Bridge & Mail
  • From: Peter Schmidt <email@hidden>
  • Date: Fri, 29 Feb 2008 01:39:42 -0800

Hello List,

I'm trying to generate an Email via Apple Scripting Bridge. Everything works fine, but can't add an attachment to it. I had tryed several ways, but it doesn't work. Can anybody help me to get it work?

Here ist a code snippet:

    AppleMailApplication *mail = [SBApplication applicationWithBundleIdentifier: @"com.apple.mail"];
    AppleMailOutgoingMessage *message = [[[mail classForScriptingClass: @"outgoing message"] alloc] init];

    NSDictionary *path = [NSDictionary dictionaryWithObject: @"Merkur:Users:schmidt:Desktop:image.tiff" forKey: @"file name"];
    [[mail outgoingMessages] addObject: message];

    [message setSubject: @"This is my subject";
    [message setContent: @"This ist my content";
    [message setVisible: YES];

   // This doesn't work, but I don't not why.
    AppleMailAttachment *attachment = [[[mail classForScriptingClass: @"attachment"] alloc] initWithProperties: path];
    [[[message content] attachments] addObject: attachment];
    // [attachment setFileName: @"Merkur:Users:schmidt:Desktop:DiscItemDisc.tiff"];

    [mail activate];


Thanks so far,
Peter
_______________________________________________

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 & Mail
      • From: Manfred Schwind <email@hidden>
  • Prev by Date: Compilation: error on linking libcurl PPC 7.18 on my Cocoa project
  • Next by Date: Better Anti-Aliasing for drawing?
  • Previous by thread: Compilation: error on linking libcurl PPC 7.18 on my Cocoa project
  • Next by thread: Re: Scripting Bridge & Mail
  • Index(es):
    • Date
    • Thread