I'm trying to reply to a mail in Mail.app with py-appscript.
I tried the code below,
from appscript import *
mailapp = app('Mail')
# get mail to be replied
msg = mailapp.accounts.first.mailboxes.first.messages.first
# create reply mail
reply_msg = mailapp.reply(msg)
# set mail (got error)
reply_msg.visible.set(True)
reply_msg.subject.set('replied message')
reply_msg.content.set('some content')
but got following error, it failed to set subject. (setting visible property is succeeded)
CommandError: Command failed:
OSERROR: -10000
MESSAGE: Apple event handler failed.
COMMAND: app(u'/Applications/Mail.app').outgoing_messages.ID(465702416).subject.set('replied message')
It works when I use "make" instead of "reply" to create new message.
# create new mail
msg = mailapp.make(new=k.outgoing_message)
# set mail (works fine)
msg.visible.set(True)
msg.subject.set('new mail')
msg.content.set('some content')
Can you please tell me what this error is and how to fix it?