如何用AppleScript为Apple Mail邮件添加3个Cc收件人
在Apple Mail的AppleScript中添加Cc收件人
要给邮件添加3个Cc收件人,只需在现有代码的tell theNewMessage代码块内,仿照添加to recipient的方式,添加cc recipient对象即可。以下是修改后的完整代码:
tell application "Mail" set theNewMessage to make new outgoing message with properties {visible:true, subject:"Update", content:"Hi, Tom. All set: … on the server. thx. -paul."} tell theNewMessage -- 添加To收件人(注意替换原代码的中文引号为英文引号) make new to recipient at end of to recipients with properties {address:"tom@zepoffice.com"} -- 添加3个Cc收件人 make new cc recipient at end of cc recipients with properties {address:"cc1@example.com"} make new cc recipient at end of cc recipients with properties {address:"cc2@example.com"} make new cc recipient at end of cc recipients with properties {address:"cc3@example.com"} activate end tell end tell
关键说明:
- 添加Cc收件人的语法和To收件人一致,仅需将
to recipient替换为cc recipient,to recipients替换为cc recipients。 - 原代码中
address:”tom@zepoffice.com"使用了中文双引号,会导致脚本报错,需替换为英文双引号"tom@zepoffice.com"。 - 可根据实际需求修改
cc1@example.com、cc2@example.com、cc3@example.com为真实邮箱地址。
内容的提问来源于stack exchange,提问作者Paul
相关产品推荐
相关产品推荐

