【发布时间】:2020-07-02 03:00:07
【问题描述】:
我正在尝试使用 Applescript 将所有电子邮件的正文内容从 Mac Mail 中的特定文件夹提取到 Excel 电子表格中。我可以用下面的代码做到这一点,但由于某种原因,并不是所有的正文内容(只是文本)都被提取出来,它在一个关键点被截断,就在获取目标电子邮件地址之前或中间,典型的!
tell application "Microsoft Excel"
set LinkRemoval to make new workbook
set theSheet to active sheet of LinkRemoval
set formula of range "A1" of theSheet to "Date"
end tell
tell application "Mail"
set theRow to 2
set theAccount to "Exchange"
get account theAccount
set theMessages to messages of mailbox "Inbox/Target Folder" of account "Exchange"
repeat with aMessage in theMessages
my SetMessage(content of aMessage, theRow, theSheet)
set theRow to theRow + 1
end repeat
end tell
on SetMessage(theMessage, theRow, theSheet)
tell application "Microsoft Excel"
set theRange to "A" & theRow
set formula of range theRange of theSheet to theMessage
end tell
end SetMessage
有人告诉我,将其提取到 CSV 文件可能会有所帮助,但我不知道如何使用 Applescript 执行此操作...有人可以帮忙吗?我是新语言!
约翰
【问题讨论】:
标签: excel macos applescript