on perform_mail_action(theData)其中“NO NAME:images:”是我的保存目录,YMMV。
tell application "Mail"
set theSelectedMessages to |SelectedMessages| of theData
set theRule to |Rule| of theData
repeat with a from 1 to count theSelectedMessages
set theOutputFolder to ("NO NAME:images:") as string
set theMessages to selection
set theMessage to item a of theMessages
set theAttachments to every attachment of content of theMessage
repeat with b from 1 to length of theAttachments
set theAttachment to item b of theAttachments
try
set theAttachmentName to name of theAttachment
set theSavePath to theOutputFolder & theAttachmentName
save theAttachment in theSavePath
end try
end repeat
end repeat
end tell
end perform_mail_action
OSX, Windows, Office for mac, SharePoints, Networking, Uphuck

