【问题标题】:save mail attachment from applescript in Lion在 Lion 中保存来自 applescript 的邮件附件
【发布时间】:2011-10-11 06:55:16
【问题描述】:

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

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"

而且也不可能通过触摸创建文件:

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"

Google 发现的多个消息来源称,上述方法在 Snow Leopard 下运行良好,但在 Lion 中却不行。有什么解决办法吗?

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

【问题讨论】:

    标签: applescript osx-lion


    【解决方案1】:

    Automator 怎么样? Get Attachments from Mail Messages 操作会起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-05
      • 2017-05-04
      • 1970-01-01
      • 2018-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多