AppleScript代码:添加选定邮件中的多个地址到指定规则
创始人
2024-09-10 21:30:12
0

要使用AppleScript将选定邮件中的多个地址添加到指定规则中,您可以按照以下步骤进行操作:

  1. 打开AppleScript编辑器。您可以在“应用程序”文件夹中找到它。

  2. 创建一个新的AppleScript文件。

  3. 在文件中输入以下代码:

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
  1. 将代码中的“指定规则的名称”替换为您想要添加地址的规则的名称。

  2. 将代码中的“移动到邮箱的名称”替换为您想要将邮件移动到的邮箱的名称。

  3. 点击AppleScript编辑器中的“运行”按钮。

  4. 选择您想要添加地址的邮件。

  5. 等待脚本运行完成,它将会将选定邮件中的地址添加到指定规则中。

请注意,这是一个示例代码,您需要根据您的具体情况进行修改。

相关内容

热门资讯

透视脚本!wepoker底牌透... wepoker底牌透视脚本app新手教程相关信息汇总(需添加指定Q群1067239143获取下载链接...
透视软件!wepoker透视底... 透视软件!wepoker透视底牌脚本,wpk透视怎么安装,我来教教你(本来有挂);(需添加指定Q群1...
透视真的!德普之星有没有挂,w... 透视真的!德普之星有没有挂,wpk辅助器,透明挂教程(本来是有挂);一、德普之星有没有挂AI软件牌型...
辅助透视!智星德州菠萝安装,w... 辅助透视!智星德州菠萝安装,wepoker可以透视码,存在挂教程(从来存在有挂);揭秘教程安装方法样...
透视透视!德普之星辅助正版,w... 透视透视!德普之星辅助正版,werplan怎么透视,揭秘攻略(本然存在有挂);德普之星辅助正版软件透...
透视线上!hhpoker透视脚... 透视线上!hhpoker透视脚本下载,德普之星透视辅助插件,力荐教程(原本是有挂)1、不需要AI权限...
透视有挂!wepoker免费永... 透视有挂!wepoker免费永久脚本,wpk透视辅助方法,攻略教程(往昔是有挂);wepoker免费...
透视ai!智星菠萝辅助器,hh... 透视ai!智星菠萝辅助器,hhpoker德州挂真的有吗,辅助教程(原先是有挂);科技详细教程Q群《1...
透视安装!红龙poker辅助,... 这是一款非常优秀的红龙poker辅助 ia辅助检测软件,能够让你了解到红龙poker辅助中牌率当中全...
透视好友!wepoker免费透... 透视好友!wepoker免费透视脚本,德州辅助工具到底怎么样,新2025版(果然真的是有挂);玩家在...