2

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
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
  • Interestingly, I've just tried this AppleScript code in MacOS 10.12 and it works. Can anyone else confirm that this is fixed? – Amy Worrall Mar 06 '17 at 11:42

2 Answers2

1

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

adayzdone
  • 11,120
  • 2
  • 20
  • 37
  • Do you know if this is documented anywhere? (I don't think you're wrong, but it would be nice to know if it was a bug or intentional!) – Amy Worrall Dec 28 '14 at 14:07
  • 1
    I haven't seen it documented other than through the many complaints in the forums over several years. – adayzdone Dec 30 '14 at 17:48
0

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