I’m currently running this in Apple Mail:
set theDraftMessage to make new outgoing message with properties {subject:theNewSubject, content:theNewBody}
tell theDraftMessage
set visible to false
make new to recipient at end of to recipients with properties {name:theProcessName, address:theDraftRecipient}
end tell
save theDraftMessage
This properly creates a new email message and puts it in the Drafts mailbox that is associated with the recipient mail account.
However, since this process doesn’t create mail messages meant for sending, I would like to save the message into a discrete mailbox, a local mailbox…
So I would need something like:
set theDraftMessage to make new outgoing message with properties {subject:theNewSubject, content:theNewBody}
tell theDraftMessage
set visible to false
make new to recipient at end of to recipients with properties {name:theProcessName, address:theDraftRecipient}
end tell
save theDraftMessage to mailbox theDefaultMailbox
But this doesn’t work.
Alternatively, I tried using AppleScript to move the saved message from Drafts to the local mailbox with
set mailbox of theDraftMessage to mailbox theDefaultMailbox
and
move theDraftMessage to mailbox theDefaultMailbox
but both don’t work, even though it is no problem to manually move a message from Drafts to a local mailbox in the GUI.
But for some reason AppleScript neither lets me save a draft directly to a non-Drafts mailbox, nor move a message from Drafts to a non-Drafts mailbox.
Is there anyone who knows a solution or workaround?
tia