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 使用带Outlook的AppleScript分析和查找电子邮件地址中的字符串_Email_Outlook_Applescript - Fatal编程技术网

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

Email 使用带Outlook的AppleScript分析和查找电子邮件地址中的字符串,email,outlook,applescript,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

我正在尝试在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

我可以通过更换 将sTo设置为的电子邮件地址(获取收件人i的邮件)为文本


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

您说,“但是当需要查看地址以进行调试时,我被卡住了”,但您还没有表示您被卡住的原因或期望得到什么,等等。如果您需要调试代码的帮助,那么你的问题应该符合。我没有Outlook,所以我无法测试任何特定于它的内容,但是我会创建一个,然后使用它查看目标是否在列表中,然后采取相应的行动。例如,
如果列表中包含此地址,则
…@user3439894您是对的。我不是很清楚。我在记录“sTo”时出错。忘了错误是什么。我在下面把它修好了。