Script Creates Emails (Dark Mode) Text is White In Light Mode

Hi there,

I’m facing an issue with an email I’m using applescript to generate.

‘User A’ is using MacOS Catalina with Dark Mode activated. Script populates new email. Email is sent manually.

‘User B’ is using MacOS Catalina in Light Mode. Email copy is appearing in white, so is illegible.

Has anyone come across this issue? I have included a snippet of the code I am using to generate the body content of the email:

tell application "Mail"
		activate
		set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
		tell theMessage
			make new to recipient with properties {name:recipientName, address:recipientAddress}
			set properties of every paragraph to {font:"Lucida Grande", size:"12"}
			set properties of paragraph 4 to {font:"Helvetica-Bold"}
			set properties of paragraph 5 to {font:"Helvetica-Bold"}
			set properties of paragraph 13 to {font:"Helvetica-Bold"}
			set properties of paragraph 26 to {font:"Helvetica-Bold"}
		end tell
	end tell

Since a decade I have been waiting “agonized” on a dark mode cause it’s healthier for our eyes and now it’s finally part of mac’s default installation, “blessed” by Apple. A late decision, for most this feature is just a useless eye candy, for those who don’t care about heath

Anyway, tell person B to use dark mode too. Makes sense. I am on Mojave and there I get all emails with white background. Maybe person B needs just to check the preferences to display mails the right way?
After lunch I will check your code.

The script changes the font depending its paragraph, its color is set to black, the size changes with the paragraph too, if you wish so.

tell application "Mail"
	set addSubj to "" #Mail subject
	set mailBody to "A\n\tC\n\tF\n\tV\n\t" #content of your mail
	set newMessage to make new outgoing message with properties {subject:addSubj, content:mailBody, visible:true}
	
	#White = {65535, 65533, 65534}
	#Black = {0, 0, 0}
	set {FavFont1, FavFont2, Size1, Size2, BlCol} to {"Helvetiva-Bold", "Lucida Grande", "12", "10", {0, 0, 0}} #{65535, 65533, 65534}
	set {RecipientNm, RecipientMail} to {"", ""}
	tell newMessage
		make new to recipient at end of to recipients with properties {name:RecipientNm, address:RecipientMail}
		set cc to 0
		repeat with a in (paragraphs of mailBody)
			set cc to cc + 1
			if cc is in {4, 5, 13, 26} then
				set a to {font:FavFont1, color:BlCol, size:Size1}
			else
				set a to {font:FavFont2, color:BlCol, size:Size2}
			end if
		end repeat
	end tell
	save
	activate
end tell