0

我编写了一个 AppleScript,将选定的电子邮件移至垃圾箱。该脚本在这方面工作正常。问题是电子邮件仍保留在服务器上。是否需要添加其他代码才能做到这一点?这是代码:

using terms from application "Mail"
on perform mail action with messages these_messages for rule this_rule
    tell application "Mail"
        set the message_count to the count of these_messages
        repeat with i from message_count to 1 by -1
            set this_message to item i of these_messages
            set this_content to (every character of content of this_message) as Unicode text
            if "bowles" is not in this_content and "patton" is not in this_content then
                set theAccount to account of mailbox of this_message
                set mailbox of this_message to mailbox "Trash" of theAccount
            end if
        end repeat
    end tell
end perform mail action with messages
end using terms from
4

2 回答 2

0

可悲的是,答案似乎是为电子邮件源创建单独的规则。最后,我只是退订了邮件列表,因为多年来我没有从他们那里看到任何有用的信息。

于 2012-09-24T18:39:24.527 回答
0

如果不查看整个脚本和可能导致问题的其他规则,就很难进行故障排除。尝试将停止评估规则操作添加到您的规则:

在此处输入图像描述

using terms from application "Mail"
on perform mail action with messages these_messages for rule this_rule
    tell application "Mail"
        repeat with this_message in these_messages
            set this_content to content of this_message
            if "bowles" is not in this_content and "patton" is not in this_content then
                set theAccount to account of mailbox of this_message
                set junk mail status of this_message to false
                set mailbox of this_message to mailbox "Trash" of theAccount
            end if
        end repeat
    end tell
end perform mail action with messages
end using terms from
于 2012-03-07T23:01:09.660 回答