Applescript for Outlook 2011,用于将与源帐户匹配的特定文件夹中的所有邮件移动到其他文件夹

Applescript for Outlook 2011,用于将与源帐户匹配的特定文件夹中的所有邮件移动到其他文件夹,outlook,applescript,account,Outlook,Applescript,Account,正如标题所述,“Outlook 2011的Applescript帮助,该帮助可将与源帐户匹配的特定文件夹中的所有邮件移动到其他文件夹。” 因此,我有一个“规则”,将exchange帐户上的所有新邮件移动到计算机子文件夹中的“收件箱”中。当我从子文件夹收件箱中删除邮件时,它会进入我计算机上的“已删除邮件”。我已在“收件箱”子文件夹的同一位置为“已删除邮件”创建了一个子文件夹,我希望按计划运行Applescript,该脚本可以进入我计算机上的主要已删除邮件,并从该exchange帐户中查找邮件,并将

正如标题所述,“Outlook 2011的Applescript帮助,该帮助可将与源帐户匹配的特定文件夹中的所有邮件移动到其他文件夹。”

因此,我有一个“规则”,将exchange帐户上的所有新邮件移动到计算机子文件夹中的“收件箱”中。当我从子文件夹收件箱中删除邮件时,它会进入我计算机上的“已删除邮件”。我已在“收件箱”子文件夹的同一位置为“已删除邮件”创建了一个子文件夹,我希望按计划运行Applescript,该脚本可以进入我计算机上的主要已删除邮件,并从该exchange帐户中查找邮件,并将其移动到“子文件夹/已删除邮件”中

通过谷歌搜索,我将以下内容拼凑在一起,这将移动所有已删除邮件:

tell application "Microsoft Outlook"
set topFolder to mail folder "AT&T" of on my computer
set destFolder to folder "Deleted Items" of topFolder
move every message of mail folder "Deleted Items" of on my computer to destFolder
end tell
我无法通过的部分现在只是有选择地移动“帐户”为特定值的邮件,如下所示:

tell application "Microsoft Outlook"
set topFolder to mail folder "AT&T" of on my computer
set destFolder to folder "Deleted Items" of topFolder
move (every message of mail folder "Deleted Items" of on my computer whose account = "Att") to destFolder
end tell
尝试按帐户筛选的最后一次添加会引发错误

Microsoft Outlook got an error: Can’t make account into type specifier.

谢谢你的帮助

设计了一个有效的解决方案。取而代之的是选择文件夹中的所有邮件并循环浏览,将帐户名作为文本抓取,然后进行比较和移动

tell application "Microsoft Outlook"
    set topFolder to mail folder "AT&T" of on my computer
    set destFolder to folder "Deleted Items" of topFolder
    set srcFolder to mail folder "Deleted Items" of on my computer
    set selectedMessages to messages of srcFolder
    repeat with theMessages in selectedMessages
        set thisAccount to account of theMessages
        if (name of thisAccount as text is "Att") then
            if (is read of theMessages is false) then
                set theMessages's is read to true
            end if
            move theMessages to destFolder
        end if
    end repeat
end tell

设计了一个有效的解决方案。取而代之的是选择文件夹中的所有邮件并循环浏览,将帐户名作为文本抓取,然后进行比较和移动

tell application "Microsoft Outlook"
    set topFolder to mail folder "AT&T" of on my computer
    set destFolder to folder "Deleted Items" of topFolder
    set srcFolder to mail folder "Deleted Items" of on my computer
    set selectedMessages to messages of srcFolder
    repeat with theMessages in selectedMessages
        set thisAccount to account of theMessages
        if (name of thisAccount as text is "Att") then
            if (is read of theMessages is false) then
                set theMessages's is read to true
            end if
            move theMessages to destFolder
        end if
    end repeat
end tell
使用Mac Outlook v15(2016),我必须删除“在我的计算机上”才能使其正常工作。否则的话,效果会很棒!谢谢@Cmstreeter。使用Mac Outlook v15(2016),我必须删除“在我的计算机上”才能使其正常工作。否则的话,效果会很棒!谢谢@Cmstreeter。