我已经安装了OS x 10.10.1现在此脚本不起作用:
tell application "Mail"
set theSelectedMessages to selection
set this_message to item 1 of the theSelectedMessages
tell this_message
set these_attachments to every mail attachment
repeat with z from 1 to the count of these_attachments
set this_attachment to item z of these_attachments
set this_name to the name of this_attachment as text
.........等等
我收到消息:苹果事件例程中的错误。错误出现在以下行中:"为每个邮件附件设置these_attachments"
在 10.9 中,脚本工作了。
沃沃woide@wwp-service.de
来自奥兹国的G'day
您的代码稍作修改即可工作。我认为您对"选择"的使用可能有问题,但尚未对其进行测试。尝试"选定的邮箱"。
问候
布莱恩圣诞节
tell application "Mail"
set theSelectedMessages to messages of mailbox "* items to shift"
set this_message to item 1 of the theSelectedMessages
tell this_message
set these_attachments to every mail attachment
set AttachmentNames to {}
repeat with z from 1 to the count of these_attachments
set this_attachment to item z of these_attachments
set this_name to the name of this_attachment as rich text
set end of AttachmentNames to this_name as rich text
end repeat
end tell
end tell
AttachmentNames & return & z
--> {"2014-11-10 233839Z.zip", "2014-11-10 233839Z.zip", "(20141110233839Z 2).pdf", "2014-11-10 233839Z", "
", 4}