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

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

问题描述

寻找如何选定的Outlook邮件信息保存为我的Mac上一个.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.

它保存消息为文本文件。我这样做的原因是那么我可以用Spotlight搜索文本文件更好。

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.

更不会有问题读取文件

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

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

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

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