将具有特定主题的电子邮件正文内容复制到数字应用程序中

时间:2019-03-05 21:18:03

标签: automation applescript applescript-numbers

我正在尝试从特定帐户(因为我有四个)中获取具有特定主题的所有电子邮件,然后接收这些邮件的内容,然后使用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 \”的{{{ / em>

有人对此问题有解决方案吗?我做错了什么?

1 个答案:

答案 0 :(得分:0)

尝试更改访问此内容的内容:

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

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