• Wieder einmal haben uns unsere Apfeltalker tolle Fotos zur Abstimmung eingesandt. Welches ist Euer Favorit? Stimmt mit ab! Hier geht es zur Abstimmung --> Klick
  • Es ist bereits Apfeltalk-Tradition und wir möchten sie auch in diesem Jahr fortsetzen: Unser Apfeltalk-Weihnachtslogo-Wettbewerb hat begonnen! Gestaltet für uns das Weihnachtsbanner, das im Monat Dezember bis zum Weihnachtsfest unsere Webseite schmücken soll. Lasst Eurer Kreativität freien Lauf! Hier geht es zum Wettbewerb --> Klick

Mail Anhänge automatisch sichern

columbo1979

Empire
Registriert
04.05.17
Beiträge
86
Hallo,

ich suche nach einer Möglichkeit, welche PDF Dateien aus Mails automatisch unter Downloads speichert.
Vieles im Netz gefunden (über Automator oder auch Scripts) welche alle nicht wirklich funktionieren.

Jemand ein Tipp?

Zuletzt:

using terms from application „Mail“

on perform mail action with messages theMessages for rule theRule

tell application „Mail“

repeat with oneMessage in theMessages

set {mail attachment:theAttachments} to oneMessage

repeat with oneAttachment in mail attachments of oneMessage

save oneAttachment in („/Users/xxx/Downloads“) & (name of oneAttachment)

end repeat

end repeat

end tell

end perform mail action with messages

end using terms from

Aber auch dies geht leider nicht :-(

Gruß und danke schon mal
 
Danke dir. leider klappt auch dieses Script nicht:

on perform_mail_action(ruleData)

-- The folder to save the attachments in (must already exist)
set attachmentsFolder to ((path to home folder as text) & "Documents:Attachments") as text

-- Save in a sub-folder based on the name of the rule in Mail
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

-- Get incoming messages that match the rule
tell application "Mail"
set selectedMessages to |SelectedMessages| of ruleData
repeat with theMessage in selectedMessages

-- Get the date the message was sent
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))

-- Save the attachment
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