• 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
Another Mail Script Fails on El Capitan – Send Styled Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another Mail Script Fails on El Capitan – Send Styled Text


  • Subject: Another Mail Script Fails on El Capitan – Send Styled Text
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 26 Nov 2015 20:09:56 -0600

Hey Folks,

I just noticed this isn't working on 10.11.1.

-------------------------------------------------------------------------------------------
# Auth: Mark Munro (Macscripter)
# dCre: 2013/08/04 01:09
# dMod: 2015/11/26 19:48
# Appl: Mail
# Task: Make new HTML email!
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Mail, @New, @Message, @HTML, @Content
-------------------------------------------------------------------------------------------

set textBody to "<HTML>
<BODY bgcolor=\"#99CCFF\">
   <H1>Hi There</H1>
   <p>This is very minimal <u>\"hello world\"</u> HTML document.</p> 
</BODY>
</HTML>"

set textSubject to "HTML Test"
set toAddress to "email@hidden"
set toName to "Me"

mailMessageCreate(toName, toAddress, textSubject, textBody)

on mailMessageCreate(toName, toAddress, textSubject, textBody)
  tell application "Mail"
    activate
    set refMessage to make new outgoing message with properties {subject:textSubject, visible:true} -- visible MUST be false to work
    tell refMessage
      set html content to textBody -- must set the _HTML CONTENT_ rather than the _CONTENT_
      make new to recipient at end of to recipients with properties {name:toName, address:toAddress}
      send
    end tell
  end tell
end mailMessageCreate

-------------------------------------------------------------------------------------------

Can someone confirm?

It seems to me Shane presented an ASObjC method of doing this a while back.

Yeah, I found it:

http://prod.lists.apple.com/archives/applescript-users/2015/Aug/msg00073.html

Still causing Script Debugger to hang but working from Script Editor.

NOT working from Keyboard Maestro though, damn it...

DOES work from FastScripts.

--
Best Regards,
Chris

 _______________________________________________
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

  • Follow-Ups:
    • Re: Another Mail Script Fails on El Capitan – Send Styled Text
      • From: Yvan KOENIG <email@hidden>
    • Re: Another Mail Script Fails on El Capitan – Send Styled Text
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: How to get the number of items in a selected Folder ?
  • Next by Date: Re: How to get the number of items in a selected Folder ?
  • Previous by thread: Re: How to get the number of items in a selected Folder ?
  • Next by thread: Re: Another Mail Script Fails on El Capitan – Send Styled Text
  • Index(es):
    • Date
    • Thread