【问题标题】:AppleScript iterating through Outlook messages - time received is missing valueAppleScript 遍历 Outlook 消息 - 收到的时间缺失值
【发布时间】:2023-03-21 04:03:01
【问题描述】:

我正在使用 AppleScript 迭代(使用转发器)通过 Outlook 文件夹中的消息,我可以在第一次迭代时访问 TIME RECEIVED,但在后续迭代中,TIME RECEIVED 是“缺失值”

将代码缩减到问题区域,仍然重现错误。 使用 MacOS Mohave 10.14.4、Office 365 for Mac/Home 版、Outlook v16.25

tell application "Microsoft Outlook"
    set msgs to messages of folder "Sent" of default account
    repeat with msg in msgs
        set messageTime to time received of msg
        set y to year of messageTime -- 1st time through is OK, each add'l time says missing value
        display notification "" & y
        delay 1
    end repeat
end tell

脚本编辑器中的实际错误消息是“无法获取缺失值的年份”。

尝试切换收件箱与已发送,同样的问题。

【问题讨论】:

    标签: macos outlook applescript message


    【解决方案1】:

    我的错误 - 应该使用 TIME SENT,而不是 TIME RECEIVED。而且我没有检查空值(新手错误!):)

    set messageTime to time received of msg

    应该是:

    set messageTime to time sent of msg

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-22
      • 2018-12-14
      • 2021-03-12
      • 1970-01-01
      • 2014-04-29
      • 2015-10-06
      • 2016-09-14
      • 1970-01-01
      相关资源
      最近更新 更多