2016-10-04 48 views
1

由于我安装了Sierra,我无法获得之前工作过的AppleScript工作片。使用AppleScript设置传出消息的消息签名

我试图创建一个消息(在Apple邮件中)与签名,但不断收到错误。

我用来创建/填充这样的消息:

set msg to make new outgoing message with properties {content:messageContent} 
set message signature of msg to signature "X" 

塞拉利昂在此之前的工作完美,现在我得到一个错误说:Mail got an error: AppleEvent handler failed.

所以,我想几件事情,结束了(使用AppleScript字典)与:

set msg to make new outgoing message with properties {content:messageContent, message signature:signature "X"} 

其中在错误结束说:Mail got an error: Can’t make class outgoing message.

任何人都可以帮我解决这个问题吗?

回答

0

这是一个已知的错误。我遇到过同样的问题。

您也没有提及这是邮件的原始回复。可能想在未来的帖子中包含应用程序!

+0

好的,谢谢你的回答。 我更新了提到Apple Mail的问题,感谢您指出这一点。 –

0

我遇到了同样的问题,遇到了一个工作解决方案。在过去的周末我升级到Sierra 10.12.4之前,“按钮3”曾经是“按钮2”。

击键“F”,只是我的签名名的第一个字母。如你所愿修改。

try 
    set message signature of theMessage to signature "your signature name" 

on error 

    tell application "Mail" to activate 
    tell application "System Events" 
     tell process "Mail" 
      click pop up button 3 of window 1 
      delay 0.01 
      keystroke "F" 
      delay 0.01 
      keystroke return 
      delay 0.01 
     end tell 
    end tell 

end try