保存邮件​​附件从狮子的AppleScript [英] save mail attachment from applescript in Lion

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

问题描述

看来,这与节约AppleScript的邮件附件的方法是狮子断下。假设,'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?在获得Mail邮件附件操作是可行的。

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

这篇关于保存邮件​​附件从狮子的AppleScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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