на просторах интеренета нашел скрипт для сохранения вложения из письма.
настроил правило: от адресата перемещать в папку и запустить скрипт.
проблема в том что вложения не сохраняются!
скрипт ниже.
[ Скрипт]
on perform_mail_action(ruleData)
set attachmentsFolder to ((path to home folder as text) & "Documents:Attachments") as text
set subFolder to name of |Rule| of ruleData as text
tell application "Finder"
if not (exists folder subFolder of folder attachmentsFolder) then
make new folder at attachmentsFolder with properties {name:subFolder}
end if
end tell
tell application "Mail"
set selectedMessages to |SelectedMessages| of ruleData
repeat with theMessage in selectedMessages
set {year:y, month:m, day:d, hours:h, minutes:min} to theMessage's date sent
set timeStamp to ("" & y & "-" & my pad(m as integer) & "-" & my pad(d) & "-" & my pad(h) & "-" & my pad(min))
repeat with theAttachment in theMessage's mail attachments
set originalName to name of theAttachment
set savePath to attachmentsFolder & ":" & subFolder & ":" & timeStamp & " " & originalName
try
save theAttachment in savePath
end try
end repeat
end repeat
end tell
end perform_mail_action
on pad(n)
return text -2 thru -1 of ("00" & n)
end pad