• 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: Yosemite Mail — New Message from Template
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yosemite Mail — New Message from Template


  • Subject: Re: Yosemite Mail — New Message from Template
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 13 Aug 2015 10:57:07 +1000

On 13 Aug 2015, at 9:39 am, Christopher Stone <email@hidden> wrote:

Unfortunately I can't figure out a way to reopen it for editing via normal AppleScript.

Here's an alternative that leaves the message open:

use AppleScript version "2.3"
use scripting additions
use framework "Foundation"

on doIt()
set theSource to "<html><body><H1>It can be done</H1><hr><p><a href="" href="http://www.macosxautomation.com/applescript/apps/\" class="">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


-- 
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: 
 >Yosemite Mail — New Message from Template (From: Christopher Stone <email@hidden>)

  • Prev by Date: Yosemite Mail — New Message from Template
  • Next by Date: Playing with ASObjC - Rename PayPal Statement
  • Previous by thread: Yosemite Mail — New Message from Template
  • Next by thread: Playing with ASObjC - Rename PayPal Statement
  • Index(es):
    • Date
    • Thread