Applescript:将选定的 Outlook 邮件另存为 .eml 文件 [英] Applescript: Save Selected Outlook Message as .eml File

查看:34
本文介绍了Applescript:将选定的 Outlook 邮件另存为 .eml 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找有关如何在我的 Mac 上将选定的 Outlook 邮件消息另存为 .eml 文件的一些指南或提示.

Looking for some guidelines or tips on how to save a selected Outlook mail message as a .eml file on my Mac.

是否有一个简单的命令,或者我是否必须使用所选消息中的内容实际编写文件?

Is there an easy command for this or do I have to actually write the file using the contents from the selected message?

推荐答案

这是我使用的脚本的摘录.

Hi this is an extract from a script I use.

您只需将电子邮件保存到一个文件中.

You just have to save the email to a file.

它将消息保存为文本文件.我这样做的原因是我可以使用聚光灯更好地搜索文本文件.

It saves the message as a text file. The reason I do this is I can then Search the text file better with spotlight.

如果我在 TextEdit 中打开文本文件,我会看到原始电子邮件.不太好读.但我实际上可以将它拖到 Dock 中的 Outlook 图标上,它会作为普通的 Outlook 电子邮件打开.

If I open the text file in TextEdit I see the raw email. Not very readable. But I can actually drag it onto the Outlook icon in the Dock and it will open as a normal outlook email.

  set folderPath to ((path to home folder from user domain as string) & "MS_Emails") --PATH TO YOU FOLDER
--TEST IF FOLDER EXISTS. IF NOT CREATE IT
if (do shell script "/bin/test -e " & quoted form of (POSIX path of folderPath) & " ; echo $?") is "1" then
    -- 1 is false
    do shell script "/bin/mkdir -p " & quoted form of (POSIX path of folderPath)

end if

tell application "Microsoft Outlook"
    -- GET SELECTE EMAILS
    set messages_ to the selection

    --ITERATE THROUGH THEM AND SAVE THEM
    repeat with i from 1 to number of items in messages_
        set theMsg to item i of messages_
        set textPath to folderPath & "email.txt" as string
        save theMsg in (textPath)

    end repeat
end tell

如果您将扩展名更改为 .eml 而不是 txt.当您双击该文件时,您的默认电子邮件应用程序将打开它.就我而言,这将是 Mail.app,但您的可能是 Outlook.

If you change the extension to .eml instead of txt. Your default email app will open it when you double click on the file. In my case that will be Mail.app but yours maybe Outlook.

读取文件都不会出现问题

Neither will have a problem reading the file

您可以使用多种方法为每个文件设置唯一名称..

You can use various methods to set a unique name to each file..

这篇关于Applescript:将选定的 Outlook 邮件另存为 .eml 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆