• 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: Mail slow creating html message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail slow creating html message


  • Subject: Re: Mail slow creating html message
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 04 Dec 2013 22:27:54 +1100

On 2 Dec 2013, at 5:16 PM, Christopher Stone <email@hidden> wrote:

If memory serves there's no way to make the window visible before sending if you want to send HTML mail.

I wouldn't say no way. Put this in an ASObjC-based library. It also requires that styled email is turned on manually for some reason.

on doIt()
set theSource to "<html><body><H1>It can be done</H1><hr><p><a href="" href="http://www.macosxautomation.com/applescript/apps/\">http://www.macosxautomation.com/applescript/apps/\">Good stuff here</a></body></html>"
set theSource to current application's NSString's stringWithString:theSource
set theData to theSource's dataUsingEncoding:(current application's NSUTF8StringEncoding)
set theStyledText to current application's NSAttributedString's alloc()'s initWithHTML:theData documentAttributes:(missing value)
set mailShare to current application's NSSharingService's sharingServiceNamed:(current application's NSSharingServiceNameComposeEmail)
mailShare's setRecipients:{"email@hidden"}
mailShare's setSubject:"I wish"
mailShare's performWithItems:{theStyledText}
end doIt

You can also include attachments.

Now what you can then do with the resulting email by script, I really don't know...

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Mail slow creating html message (From: email@hidden)
 >Re: Mail slow creating html message (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: System Events -600 error
  • Next by Date: Comparing lists
  • Previous by thread: Re: Mail slow creating html message
  • Next by thread: Re: System Events -600 error
  • Index(es):
    • Date
    • Thread