I'm still trying to deal with this POS that Apple released called "Mail".
I'm able to create a message, even set the From and Signature of the message. However, the very moment that I add an attachment to the message, it hoses my signature choice.
[FTI, if you add an attachment anywhere but the *END* of a message, Windoze users can't seem to access any message content after that. Nice interface, Apple.]
This is my script... what am I doing wrong?:
set myAttachment to alias "Tesla:Users:cameron:Desktop:somefile.xlsx"
set newMessage to show_mail_sbrcbap("test message", "This is my test message", {"email@hidden"}, {"email@hidden"}, {"email@hidden
"}, {"iGods"}, myAttachment)
on show_mail_sbrcbap(subjectLine, messageText, myrecipients, myccrecipients, mybccrecipients, accountName, attachmentAlias)
tell application "Mail"
set mySender to (full name of account named accountName & " <" & user name of account named accountName & ">")
set mymail to (make new outgoing message at the beginning of outgoing messages with properties {sender:mySender, subject:subjectLine, content:messageText})
repeat with i from (count of myrecipients) to 1 by -1
tell mymail to make new to recipient at beginning of to recipients with properties {address:(item i of myrecipients)}
end repeat
repeat with i from (count of myccrecipients) to 1 by -1
tell mymail to make new to recipient at beginning of cc recipients with properties {address:(item i of myccrecipients)}
end repeat
repeat with i from (count of mybccrecipients) to 1 by -1
tell mymail to make new to recipient at beginning of bcc recipients with properties {address:(item i of mybccrecipients)}
end repeat
set visible of mymail to true
set message signature of mymail to signature (accountName as string)
-- let Mail catchup
delay 2
tell content of mymail
make new attachment with properties {file name:attachmentAlias} at after last paragraph
end tell
activate
end tell
return mymail
end show_mail_sbrcbap