0

我正在尝试从具有特定主题的特定帐户(因为我有四个)中获取所有电子邮件,然后获取这些邮件的内容并使用 AppleScript 将它们写入数字应用程序。

邮件正文包含个人信息,如电子邮件、出生日期等,我试图将这些信息组织成列。每封新电子邮件都在自己的行中。

如果您知道包含 Javascript 或 Automator 的解决方案,我愿意接受。

这是我现在所拥有的:

tell application "Numbers"
    set LinkRemoval to make new document
    set theSheet to active sheet of LinkRemoval
    set value of cell "D1" of table 1 of theSheet to "E-mail"
    set value of cell "C1" of table 1 of theSheet to "Year Of Birth"
    set value of cell "B1" of table 1 of theSheet to "Name"
    set value of cell "A1" of table 1 of theSheet to "Phone Number"
end tell

tell application "Mail"
    set theRow to 2
    set theAccount to "MyAccount"
    get account theAccount
    set theMessages to {messages of inbox whose read status is false and subject contains "Application 2019"}
    set theContent to content of theMessages
end tell

on SetMessage(theMessage, theRow, theSheet)
    tell application "Numbers"
        set theRange to "D" & theRow
        set formula of range theRange of theSheet to theContent
    end tell
end SetMessage

不幸的是,我收到错误:

错误“无法获取应用程序 \"Mail\" 的帐户 ID \"22ED50FB-BF71-4D0A-A96B-9A78E4F57C8\" 的邮箱 \"INBOX\" 的 {{message id 33410 的内容

有没有人有这个问题的解决方案?我做错了什么?

4

1 回答 1

0

尝试更改访问这一行的内容:

set theContent to {the content of every message of inbox whose read status is false and subject contains "Application 2019"}

这应该为您提供找到的每条消息的正文列表。

于 2019-03-25T01:30:41.683 回答