• 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: Data Rich email like iPhoto/Aperture?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data Rich email like iPhoto/Aperture?


  • Subject: Re: Data Rich email like iPhoto/Aperture?
  • From: Jim Puls <email@hidden>
  • Date: Thu, 1 Nov 2007 07:10:38 -0700

On Oct 31, 2007, at 10:19 PM, Ben Lachman wrote:

I'd like to push some attributed strings into an email for my users to address and send out... something like what iPhoto or Aperture do. I have an applescript that will attach a file, but it won't inline it. NSMailDelivery has been deprecated on leopard so thats [sic] not really an option (not that it was really any good before), and I'd rather not talk directly to an SMTP server. Any ideas?

This really isn't a Cocoa question, so you should probably take it to applescript-users, but I'm not sure what you mean by "will attach a file, but it won't inline it." The following AppleScript works pretty well on my machine:


tell application "Mail"
set theLocation to "/tmp/file.txt"
set theBody to "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." & return & return & return & "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
set theSubject to "Lorem ipsum"
set newMessage to (make new outgoing message with properties {subject:theSubject, content:theBody})
tell newMessage to make new cc recipient with properties {address:"CC people <email@hidden>"}
tell newMessage to make new attachment with properties {file name:theLocation} at after second paragraph
activate
end tell


NSMailDelivery is designed for directly sending messages, and it sounds like you want to bring up a compose window in Mail, not directly send a message. If this app is Leopard-only, you might look in to using the Scripting Bridge to make this in to native Objective-C code, which will give you a big speed and sanity boost.

-> jp
_______________________________________________

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: Data Rich email like iPhoto/Aperture?
      • From: Ben Lachman <email@hidden>
  • Prev by Date: Symbol not found: _NSDefaultRunLoopMode
  • Next by Date: Re: exec() with pmset
  • Previous by thread: Re: Symbol not found: _NSDefaultRunLoopMode
  • Next by thread: Re: Data Rich email like iPhoto/Aperture?
  • Index(es):
    • Date
    • Thread