在 Lion 中保存来自 Applescript 的邮件附件 [英] save mail attachment from applescript in Lion

查看:19
本文介绍了在 Lion 中保存来自 Applescript 的邮件附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,使用applescript 保存邮件附件的方法在Lion 下被破坏了.假设,'theAttachment' 已经是包含例如的正确对象附上jpg,这是我所做的:

It seems, that the method of saving a mail attachment with applescript is broken under Lion. Assume, 'theAttachment' is already the right object containing the e.g. attached jpg, here is what I've done:

set strPath to (path to pictures folder) as string
save theAttachment in strPath -- leads to the error: "„Mail" got an error: error in  AppleEvent-Routine." number -10000

save theAttachment in strPath as "test" -- leads to \"test\" can't convert into typ constant" number -1700 from "test" to constant

set fileName to strFileName as alias
save theAttachment in strPath as fileName -- error "The file „Foto-121121.jpg" wasn't found." number -43 from "Foto-121121.jpg"

而且也无法通过触摸创建文件:

And also it's not possible to create the file via touch:

set thefullpath to POSIX path of strPath & fileName
do shell script "touch \"" & thefullpath & "\"" -- error "The file „Foto-121121.jpg" wasn't found." number -43 from "Foto-121121.jpg"

谷歌发现的几个消息来源说,上面提到的方法在雪豹下运行良​​好,但在狮子中不起作用.有什么解决办法吗?

Several sources found by Google said, that the method mentioned above works well under Snow Leopard, but doesn't in Lion. Is there any workaround ?

备注:我已经把错误信息从德语翻译过来了,但是错误编号还是一样的.

Remark: I've translated the error messages from German here, but the error numbers are still the same.

推荐答案

Automator 怎么样?Get Attachments from Mail Messages 动作会起作用.

How about Automator? The Get Attachments from Mail Messages action would work.

这篇关于在 Lion 中保存来自 Applescript 的邮件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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