【问题标题】:I can't choose the "first message" in a group of selected emails (in Mail.app) using Applescript…我无法使用 Applescript 在一组选定的电子邮件(在 Mail.app 中)中选择“第一条消息”......
【发布时间】:2014-03-20 20:28:59
【问题描述】:

所以我可以遍历一组电子邮件来使用:

repeat with eachMessage in emailSelection
        log content of eachMessage
        set theContent to content of eachMessage
    end repeat

然而,当我尝试任意选择一个时,比如说集合中的第一个,我得到一个错误

        set newContent to content of first message in emailSelection

返回:

(Can't get message 1 of {message id 740166 of mailbox "INBOX' of account "IMAP PL" of application "Mail", message id 740165 of Mailbox "INBOX" of account "IMAP PL"应用程序“Mail”,应用程序“Mail”的帐户“IMAP PL”的邮箱“INBOX”的消息 ID 739792,应用程序“Mail”的帐户“IMAP PL”的邮箱“INBOX”的消息 ID 740164,邮箱的消息 ID 738259应用程序“Mail”的帐户“IMAP PL”的“INBOX”,应用程序“Mail”的帐户“IMAP PL”的邮箱“INBOX”的消息 ID 738258,帐户“IMAP PL”的邮箱“INBOX”的消息 ID 738257应用程序“邮件”}。

我想选择电子邮件集中的第一个 对象,但它似乎试图识别电子邮件 ID 为“1”,这显然不包含在所选电子邮件集中。

【问题讨论】:

    标签: email applescript


    【解决方案1】:

    您需要使用 item 关键字将 emailSelection 作为列表引用。

    例如,

    set newContent to content of (item 1 of emailSelection)
    

    set newContent to content of (the first item of emailSelection)
    

    【讨论】:

    • 哈,是的,这就是我喜欢 AppleScript 的原因,它有点像对话,但仍在等待“礼仪”插件。 '请把 this_variable 复制到剪贴板?'
    猜你喜欢
    • 1970-01-01
    • 2018-04-29
    • 2015-03-12
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 1970-01-01
    • 2013-03-11
    • 1970-01-01
    相关资源
    最近更新 更多