Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 为什么这个AppleScript会得到一个“;AppleEvent处理程序失败";Mac OS X 10.5 Leopard上的错误?_Email_Applescript_Osx Leopard - Fatal编程技术网

Email 为什么这个AppleScript会得到一个“;AppleEvent处理程序失败";Mac OS X 10.5 Leopard上的错误?

Email 为什么这个AppleScript会得到一个“;AppleEvent处理程序失败";Mac OS X 10.5 Leopard上的错误?,email,applescript,osx-leopard,Email,Applescript,Osx Leopard,首先,我知道,Leopard在这一点上已经过时了,但这是我希望能够用这个脚本支持的最低限度,所以请耐心听我说(在Mac OS X 10.4 Tiger下,这甚至是不可能的,因为一个错误) 我一直在重新构建一个AppleScript以与之协同工作,因此它会遍历垃圾邮件文件夹中的一系列邮件,并尝试将它们重定向到指定的邮箱。以下是我到目前为止得到的信息(请注意,实际发送的信息目前已被注释掉,稍后将对此进行详细说明): 当从Script Editor.app运行它时(因此它会在运行时通过和告诉我去),并

首先,我知道,Leopard在这一点上已经过时了,但这是我希望能够用这个脚本支持的最低限度,所以请耐心听我说(在Mac OS X 10.4 Tiger下,这甚至是不可能的,因为一个错误)

我一直在重新构建一个AppleScript以与之协同工作,因此它会遍历垃圾邮件文件夹中的一系列邮件,并尝试将它们重定向到指定的邮箱。以下是我到目前为止得到的信息(请注意,实际发送的信息目前已被注释掉,稍后将对此进行详细说明):

当从
Script Editor.app
运行它时(因此它会在运行时通过
告诉我去
),并在邮件中选择少量垃圾邮件(这是在Mac OS X 10.5.8 Leopard下),它似乎对第一条消息起作用(打开新的重定向消息,w/to recipient set,CC/BCC字段清空),其他重定向消息窗口打开,但其“收件人/抄送/密件抄送”字段未更新,并且
脚本编辑器。app
弹出对话框,显示“邮件出错:AppleEvent处理程序失败”错误。事件日志的内容如下:

tell application "Mail"
    get selection
        {message id 464214 of mailbox "Junk", message id 464213 of mailbox "Junk", message id 464211 of mailbox "Junk"}
    get selected mailboxes of message viewer 1
        {junk mailbox}
    get junk mailbox
        junk mailbox
    get subject of message id 464214 of mailbox "Junk"
        ": Your Invitation Into a Global Directory"
    get was redirected of message id 464214 of mailbox "Junk"
        false
    redirect message id 464214 of mailbox "Junk" with opening window
        outgoing message id 400031520
    make new recipient at beginning of every to recipient of outgoing message id 400031520 with properties {address:"junkmail@domain.tld"}
        to recipient 1 of outgoing message id 400031520
    delete every bcc recipient of outgoing message id 400031520
    delete every cc recipient of outgoing message id 400031520
    get subject of message id 464213 of mailbox "Junk"
        "Nominate Your Favorite Products for the Community Choice Awards"
    get was redirected of message id 464213 of mailbox "Junk"
        false
    redirect message id 464213 of mailbox "Junk" with opening window
        outgoing message id 378471104
    make new recipient at beginning of every to recipient of outgoing message id 378471104 with properties {address:"junkmail@domain.tld"}
        "Mail got an error: AppleEvent handler failed."
因此,显然,除了第一条消息之外,将
设置为recipients
似乎是失败的。后续运行脚本而不重新启动邮件也会导致第一条消息失败

这个问题最奇怪的部分是,当运行脚本后退出邮件时,每个重定向消息(即使是成功的消息)都会弹出一个隐藏的空白窗口,询问您是否要保存更改。这听起来与中提到的非常相似,但我不确定是什么原因造成的


那么,是什么导致了这个错误和失败呢?我如何解决它?另外,为了获得额外的奖励,为什么要创建隐藏的空白消息?我如何防止这种情况发生?

我觉得你的脚本很好


如果我是你,我会尝试在同一台计算机上的另一个OS X帐户中运行脚本,修复权限,查看日志(你已经这样做了,但这仍然是一个好主意),运行所有相关的软件更新,临时移动你的
~/Library/Mail
文件夹以消除它的影响,等等。告诉我发生了什么,特别是如果它再次工作:)

请注意,我无法在10.6上重现这一点。它在我的电脑上运行得很好。注意,很好的脚本:)你有没有发现如何避免退出时弹出的草稿(你的“隐藏窗口”?我正在尝试修复我的脚本的相同问题,但在这方面找不到任何内容。谢谢@很不幸,我没有睡着。
tell application "Mail"
    get selection
        {message id 464214 of mailbox "Junk", message id 464213 of mailbox "Junk", message id 464211 of mailbox "Junk"}
    get selected mailboxes of message viewer 1
        {junk mailbox}
    get junk mailbox
        junk mailbox
    get subject of message id 464214 of mailbox "Junk"
        ": Your Invitation Into a Global Directory"
    get was redirected of message id 464214 of mailbox "Junk"
        false
    redirect message id 464214 of mailbox "Junk" with opening window
        outgoing message id 400031520
    make new recipient at beginning of every to recipient of outgoing message id 400031520 with properties {address:"junkmail@domain.tld"}
        to recipient 1 of outgoing message id 400031520
    delete every bcc recipient of outgoing message id 400031520
    delete every cc recipient of outgoing message id 400031520
    get subject of message id 464213 of mailbox "Junk"
        "Nominate Your Favorite Products for the Community Choice Awards"
    get was redirected of message id 464213 of mailbox "Junk"
        false
    redirect message id 464213 of mailbox "Junk" with opening window
        outgoing message id 378471104
    make new recipient at beginning of every to recipient of outgoing message id 378471104 with properties {address:"junkmail@domain.tld"}
        "Mail got an error: AppleEvent handler failed."