要使用AppleScript获取邮件信息,可以使用以下代码示例:
tell application "Mail"
set inboxCount to count of messages of inbox
set emailTitles to {}
repeat with i from 1 to inboxCount
set end of emailTitles to subject of message i of inbox
end repeat
end tell
tell application "Mail"
set targetMessage to message id "邮件ID" of mailbox "收件箱"
set senderName to name of sender of targetMessage
set emailContent to content of targetMessage
end tell
tell application "Mail"
set targetMessage to message id "邮件ID" of mailbox "收件箱"
set attachmentCount to count of mail attachments of targetMessage
set attachmentNames to {}
set attachmentPaths to {}
repeat with i from 1 to attachmentCount
set end of attachmentNames to name of attachment i of targetMessage
set end of attachmentPaths to POSIX path of (downloaded message attachments folder as string) & name of attachment i of targetMessage
end repeat
end tell
请注意,上述代码示例中的"收件箱"和"邮件ID"应根据实际情况进行替换。