【问题标题】:Apple script: How to get the message id of the currently selected message in outlook appApple 脚本:如何在 Outlook 应用程序中获取当前选定消息的消息 ID
【发布时间】:2021-06-08 14:18:27
【问题描述】:

我想使用 osa 脚本在我的 Mac 上的收件箱中的阅读模式下获取当前在 Outlook 应用中打开的消息的消息 ID。

到目前为止,我已经尝试过:

tell application "Microsoft Outlook"
    set currentMessage to selection
    set header to headers of currentMessage
end tell

我收到了回复,但标头没有消息 ID

Mac OS Bir Sur,Apple M1 Outlook 16.46 Microsoft 365 订阅。

【问题讨论】:

    标签: macos outlook applescript


    【解决方案1】:

    你应该能够:

     get id of currentMessage
    

    使用 Outlook 16.44 在 Mojave 上工作。 (交换账户)

    【讨论】:

    • 我试过了,但它没有给出消息 id,它给出了一些其他类型的 id。
    【解决方案2】:

    -- 这在这里有效:

    告诉应用程序“Microsoft Outlook” 将 currentMessage 设置为选择

    set thisID to id of currentMessage
    
    get subject of message id thisID --> "test 1"
    

    说完

    【讨论】:

    • 这个 id 不是消息 id,这是某种内部 Outlook 消息 id。电子邮件 id 看起来像 你的系统上的 id 是这样的吗?
    • 啊,我明白你的意思了。我在原始脚本的结果中得到以下行: Message-ID: ...所以它肯定在我系统的标题中。
    • 好的,谢谢,我也会将我的系统配置添加到问题中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多