Hello. I have a script that I use to automatically respond to emails. The problem is that I have multiple accounts in Applemail and I want the script to send replies from the account that received the letter. How do I do that?
This is my code
tell application “Mail”
activate
set theSelection to selection
repeat with thisMessage in theSelection
set ReplyAddress to reply to of thisMessage
set theOutgoingMessage to reply thisMessage with opening window
repeat until name of front window is (subject of theOutgoingMessage)
delay 0.3
end repeat
set content of theOutgoingMessage to (myReply) as rich text
set A to to recipient 1 of theOutgoingMessage
set address of to recipient 1 of theOutgoingMessage to ReplyAddress
set subject of theOutgoingMessage to "unsubscribe avanmäl"
send theOutgoingMessage
end repeat
end tell