使用带有Outlook的AppleScript解析和查找电子邮件地址中的字符串

时间:2017-10-31 05:09:50

标签: email outlook applescript

我正在尝试在Mac上为Outlook 2016中的已接收电子邮件创建自定义规则。我需要检查收件人以检查一些地址。我有以下代码,但是当我需要查看地址以进行调试时,我会陷入困境

tell application "Microsoft Outlook"
    set theMessages to messages of folder "Inbox" of exchange account "myact"
    repeat with aMessage in theMessages
        set sSubject to subject of aMessage as text
        set sSender to address of (get aMessage's sender)
        set tContent to content of aMessage as text
        repeat with i from 1 to count of to recipients of aMessage
            set sTo to email address of (get aMessage's to recipient i) as text
            display dialog sTo
        end repeat
    end repeat
end tell

1 个答案:

答案 0 :(得分:0)

我能够通过替换解决这个问题     将sTo设置为(将aMessage's到收件人i)的电子邮件地址作为文本

与     将sTo设置为(get(aMessage的cc收件人i)的电子邮件地址)