如何将文件附加到通过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