我想知道我可以使用什么脚本将联系人中的人的电子邮件地址添加到 Mac 邮件?
到目前为止,这就是我所拥有的,它要求各种输入,然后使用这些来编译消息。消息的其余代码工作正常,但我希望脚本在“联系人”中查找此人(基于输入)并将那里列出的邮件地址添加到“收件人”字段中的消息中:
--User Inputs to get Client details
display dialog "You are about to Create Outgoing e-mail for: Test
Please enter Client's First Name:" default answer "First Name"
set ClientName to text returned of result
display dialog "Please enter Client's Last Name:" default answer "Last Name"
set ClientLastName to text returned of result
--Create e-mail
tell application "Mail"
set theMessage to make new outgoing message with properties {visible:true, subject:"Test", content:"Hi " & ClientName & ",
"}
tell theMessage
make new to recipient at end of to recipients with properties {address:ClientName & ClientLastName}
end tell
end tell
这会创建消息并将“ClientName + LastName”添加到 To 字段,但我仍然需要进入并找到邮件地址。我希望通讯簿按名字和姓氏查找此人,然后在“收件人”字段中添加他的地址。