Amy Worrall
Amy Worrall

Reputation: 16337

AppleScript with Mail, reply to email, can't set content

I can correctly create a brand new outgoing message in Mail, and set its body.

However, when I try to use the replyOpeningWindow:replyToAll: method (called on an existing mail message), I cannot set the content. Calling setContent: on the resultant MMOutgoingMessage seems to do nothing, the content of the message remains as the quoted text of the message I'm replying to.

Has anyone successfully used replyOpeningWindow:replyToAll: and then changed properties on the resultant email message?

Edit to add:

This problem isn't a Scripting Bridge issue. The same problem occurs with this AppleScript:

tell application "Mail"
    copy first message of inbox to emailMessage
    set replyMessage to reply emailMessage without opening window
    set content of replyMessage to "Hello"
    set visible of replyMessage to true
end tell

Upvotes: 2

Views: 455

Answers (2)

Ali Parsa
Ali Parsa

Reputation: 11

I had this problem too. If you add a delay before setting the content, it works.

tell application "Mail"
copy first message of inbox to emailMessage
set replyMessage to reply emailMessage without opening window
delay 0.1
set content of replyMessage to "Hello"
set visible of replyMessage to true
end tell

Upvotes: 1

adayzdone
adayzdone

Reputation: 11238

You can't change certain properties of a reply message, including content.

Upvotes: 1

Related Questions