[Mail] Anhänge von E-Mails automatisch in bestimmten Ordner speichern

thetransformer

Aktives Mitglied
Thread Starter
Dabei seit
13.07.2008
Beiträge
523
Reaktionspunkte
43
Hallo,

wie oben angekündigt möchte ich, dass Mail die Anhänge bestimmter Mails automatisch in einen bestimmten Ordner speichert. Das Erstellen von Regeln an sich ist nicht das Problem. Aber das Apple-Skript bekomme ich nicht hin.

Ich habe via Google immer wieder dieses hier gefunden:

Code:
[COLOR=#A60092][FONT=Courier]using terms from application "Mail"[/FONT][/COLOR]
[COLOR=#a60092]    on perform mail action with messages theMessages for rule theRule[/COLOR]

[COLOR=#a60092]        set theOutputFolder to "Macintosh HD:Users:Mein Name:Desktop:"[/COLOR]


[COLOR=#a60092]        tell application "Mail"[/COLOR]
[COLOR=#a60092]            set theMessage to item 1 of theMessages[/COLOR]
[COLOR=#a60092]            set theAttachments to every attachment of content of theMessage[/COLOR]
[COLOR=#a60092]            repeat with a from 1 to length of theAttachments[/COLOR]
[COLOR=#a60092]                set theAttachment to item a of theAttachments[/COLOR]
[COLOR=#a60092]                try[/COLOR]
[COLOR=#a60092]                    set theAttachmentName to name of theAttachment[/COLOR]
[COLOR=#a60092]                    set theSavePath to theOutputFolder & theAttachmentName[/COLOR]
[COLOR=#a60092]                    save theAttachment in theSavePath[/COLOR]
[COLOR=#a60092]                end try[/COLOR]
[COLOR=#a60092]            end repeat[/COLOR]
[COLOR=#a60092]        end tell[/COLOR]

[COLOR=#a60092]    end perform mail action with messages[/COLOR]
[COLOR=#a60092]end using terms from[/COLOR]

Dies scheint mir die entsprechende Zeile zu sein:

Code:
[FONT=monospace]set theOutputFolder to "Macintosh HD:Users:Mein Name:Desktop:"[/FONT]

Ich habe sie wie folgt geändert:

Code:
[FONT=monospace]set theOutputFolder to "Macintosh HD:Benutzer:Name meines Häuschens:ToDo:"[/FONT]

"ToDo" ist der Name des Zielordners. Er befindet sich auf der selben Ebene, wie auch die vorinstallierenten Ordner "Dokumente" und Downloads" etc. Ich denke, dass da irgendwo mein Fehler liegt, aber als ungeübter Skript-Nutzer, habe ich keine Ahnung.

Dazu direkt eine ergänzende Frage:

Regeln lassen sich ja via iCloud nicht mehr synchronisieren. Was nun, wenn ich Mail (IMAP) auf meinem MacBook abrufe, dort aber diese Regeln nicht definiert sind? Muss ich Arbeitsrechner (iMac) und mobiles Geräte manuell auf dem gleichen Stand (d.h. gleiche Regeln, gleiches Skript etc.) halten?

Danke im Voraus!
Besten Grut
tt
 
Zurück
Oben Unten