【发布时间】:2021-10-03 00:11:01
【问题描述】:
我有一个脚本可以根据 to recipient 过滤电子邮件,但出现错误。
这是脚本:
tell application "Mail"
set firstInboxMessage to the first message of mailbox "INBOX" of account "Account"
set theEmail to extract address from to recipient of the firstInboxMessage
set my text item delimiters to {"+", "@"}
set mailboxName to text item 2 of theEmail
set messageAccount to account of mailbox of the firstInboxMessage
tell the messageAccount to if the name of its mailboxes does not contain ¬
the mailboxName then make new mailbox at the end of its mailboxes ¬
with properties {name:mailboxName}
set newMailbox to the mailbox named mailboxName in the messageAccount
set the mailbox of the firstInboxMessage to the newMailbox
end tell
这是错误:
Mail got an error: Unrecognized direct parameter type, please specify a string like "John Doe <jdoe@example.com>"
我认为这与 to recipient 在 AppleScript 中与 subject 或 sender 的分类方式不同这一事实有关,因为当我使用其中任何一个时,脚本运行良好。
任何帮助将不胜感激。
【问题讨论】:
标签: macos email applescript