如何将文件附加到通过AppleScript的Microsoft Outlook中的新邮件? [英] How do I attach a file to a new message in Microsoft Outlook via AppleScript?

查看:375
本文介绍了如何将文件附加到通过AppleScript的Microsoft Outlook中的新邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的脚本升级到Office 365和OSX 10.10之前工作得很好:

The following script worked fine before upgrading to Office 365 and OSX 10.10:

tell application "Microsoft Outlook"
    set newMessage to make new outgoing message
    tell newMessage
        make new attachment with properties {file:"/Users/foo/file"}
    end tell
    open newMessage
end tell

但现在它给此错误消息:

But now it gives this error message:

执行错误:在保存更改的记录属性错误:Microsoft Outlook中得到一个错误。 (-2700)

已经改变过程或这是一个错误在任何OSX或Outlook?

Has the procedure changed or is this a bug in either OSX or Outlook?

推荐答案

该路径必须是一个别名 POSIX文件

转换一个POSIX路径是这样的:

Convert a posix path like this:

set x to "/Users/foo/file" as POSIX file
-- or --> set x to "/Users/foo/file" as POSIX file as alias
tell application "Microsoft Outlook"
    set newMessage to make new outgoing message
    tell newMessage
        make new attachment with properties {file:x}
    end tell
    open newMessage
end tell

这篇关于如何将文件附加到通过AppleScript的Microsoft Outlook中的新邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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