为了帮助我的用户轻松报告问题,我想尽可能多地创建电子邮件。最重要的是,我想附加一个文件(日志文件)。
如何在AppleScript中执行此操作?
答案 0 :(得分:2)
tell application "Mail"
set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject", content:"My Body"}
tell theMessage
make new to recipient at end of to recipients with properties {name:"Ben Waldie", address:"applescriptguru@mac.com"}
end tell
tell content of theMessage
make new attachment with properties {file name:pathToFile} at after last paragraph
end tell
end tell