Hi,
I want to compose a new Mail message from an AppleScript. This should be fairly easy, but I'm really struggling with getting it to work as intended in macOS Ventura.
I have cut my AppleScript down to the bare minimum example and yet it still fails me with weird formatting issues of the content.
My problems with the created message is:
I want to compose a new Mail message from an AppleScript. This should be fairly easy, but I'm really struggling with getting it to work as intended in macOS Ventura.
I have cut my AppleScript down to the bare minimum example and yet it still fails me with weird formatting issues of the content.
Code:
set theSubject to "Test"
set theContent to "Hello World"
tell application "Mail"
set default message format to plain format
activate
make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
end tell
My problems with the created message is:
- A linebreak is added before "Hello World" in the message content.
- The message is created in Rich text format no matter what I do (Mail is set to plain format in settings).
- If I manually convert the message to plain text the content gets prefixed with a quote level.