1

由于我安装了 Sierra,我无法让以前工作的 AppleScript 工作。

我正在尝试创建带有签名的消息(在 Apple Mail 中),但不断收到错误消息。

我曾经像这样创建/填充消息:

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

在 Sierra 之前,这很完美,现在我收到一条错误消息: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.

谁能帮我解决这个问题?

4

2 回答 2

0

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

您也没有在原始回复中提到这是针对 Mail 的。可能希望在以后的帖子中包含该应用程序!

于 2016-10-05T18:09:03.167 回答
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
于 2017-04-04T15:59:21.803 回答