要使用AppleScript将选定邮件中的多个地址添加到指定规则中,您可以按照以下步骤进行操作:
打开AppleScript编辑器。您可以在“应用程序”文件夹中找到它。
创建一个新的AppleScript文件。
在文件中输入以下代码:
tell application "Mail"
set selectedMessages to selection
set addresses to {}
repeat with selectedMessage in selectedMessages
set messageSender to sender of selectedMessage
set messageRecipients to every to recipient of selectedMessage
set end of addresses to messageSender
repeat with recipient in messageRecipients
set end of addresses to address of recipient
end repeat
end repeat
set ruleName to "指定规则的名称"
set ruleAction to "移动到邮箱的名称"
repeat with address in addresses
set newRule to make new rule with properties {name:ruleName}
make new rule condition at end of rule conditions of newRule with properties {expression:"sender", qualifier:equal to value, expression data:(address as string)}
make new rule action at end of rule actions of newRule with properties {type:move message, with value:mailboxes where name = ruleAction}
end repeat
end tell
将代码中的“指定规则的名称”替换为您想要添加地址的规则的名称。
将代码中的“移动到邮箱的名称”替换为您想要将邮件移动到的邮箱的名称。
点击AppleScript编辑器中的“运行”按钮。
选择您想要添加地址的邮件。
等待脚本运行完成,它将会将选定邮件中的地址添加到指定规则中。
请注意,这是一个示例代码,您需要根据您的具体情况进行修改。