我是 AppleScript 的新手,并试图弄清楚如何将 Mail.app 消息保存为 .eml 消息。理想情况下,我希望它的行为类似于“邮件”菜单栏操作,将邮件和附件保存在一起。
工作流程是您在邮件中有一个选择,点击热键,该函数newFile为要保存的电子邮件创建一个文件名 ( )。我只需要有关如何以theFolder.eml 格式将消息保存到路径 ( ) 的帮助。
tell application "Mail"
set msgs to selection
if length of msgs is not 0 then
display dialog "Export selected message(s)?"
if the button returned of the result is "OK" then
set theFolder to choose folder with prompt "Save Exported Messages to..." without invisibles
repeat with msg in msgs
-- determine date received of msg and put into YYYYMMDD format
set msgDate to …Run Code Online (Sandbox Code Playgroud)