[B]using terms from [/B][COLOR=#0433FF][FONT=Verdana][I]application[/I][/FONT][/COLOR][FONT=Verdana] "Mail"
[/FONT][COLOR=#0433FF][FONT=Verdana][COLOR=#000000] [B]on[/B] [/COLOR][B]perform mail action with messages [/B][COLOR=#4f8f00]theMessages [/COLOR]for rule [COLOR=#4f8f00]theRule[/COLOR][/FONT][/COLOR]
[COLOR=#5E6161][FONT=Verdana]-- Pfad an dem die Anhänge gespeichert werden sollen hier eintragen:[/FONT][/COLOR]
[FONT=Verdana] [B]set[/B] [COLOR=#4f8f00]theSavePath[/COLOR] [B]to[/B] "/Test/"[/FONT]
[FONT=Verdana] [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Mail"[/FONT]
[FONT=Verdana] [B]repeat[/B] [B]with[/B] [COLOR=#4f8f00]aMessage[/COLOR] [B]in[/B] [COLOR=#4f8f00]theMessages[/COLOR][/FONT]
[FONT=Verdana] [B]repeat[/B] [B]with[/B] [COLOR=#4f8f00]anAttachment[/COLOR] [B]in[/B] [COLOR=#0433ff][I]mail attachments[/I][/COLOR] [B]of[/B] [COLOR=#4f8f00]aMessage[/COLOR][/FONT]
[FONT=Verdana] [B]set[/B] [COLOR=#4f8f00]theFile[/COLOR] [B]to[/B] ([COLOR=#812fdc]POSIX path[/COLOR] [B]of[/B] ([COLOR=#012fbe][B]path to[/B][/COLOR] [COLOR=#5730be][I]downloads folder[/I][/COLOR]) [B]as[/B] [COLOR=#0433ff][I]string[/I][/COLOR]) & [COLOR=#812fdc]name[/COLOR] [B]of[/B] [COLOR=#4f8f00]anAttachment[/COLOR][/FONT]
[COLOR=#5E6161][FONT=Verdana]-- Anhänge im Downloads Ordner speichern:[/FONT][/COLOR]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#0433ff][B]save [/B][/COLOR]anAttachment [COLOR=#0433ff]in [/COLOR]theFile[/FONT][/COLOR]
[COLOR=#5E6161][FONT=Verdana]-- Anhänge verschieben, doppelte Dateien bekommen einen Suffix:[/FONT][/COLOR]
[FONT=Verdana] [COLOR=#012fbe][B]do shell script[/B][/COLOR] "downloadFile=\"" & [COLOR=#4f8f00]theFile[/COLOR] & "\";[/FONT]
[FONT=Verdana]file=\"" & [COLOR=#4f8f00]theSavePath[/COLOR] & [COLOR=#812fdc]name[/COLOR] [B]of[/B] [COLOR=#4f8f00]anAttachment[/COLOR] & "\";[/FONT]
[FONT=Verdana]i=\"\";[/FONT]
[FONT=Verdana]sep=\"\";[/FONT]
[FONT=Verdana]fileName=\"$(basename \"$file\")\";[/FONT]
[FONT=Verdana]ext=\"\";[/FONT]
[FONT=Verdana]if [[ \"$fileName\" == *.* ]];[/FONT]
[FONT=Verdana]then[/FONT]
[FONT=Verdana] ext=\".${fileName##*.}\";[/FONT]
[FONT=Verdana]fi;[/FONT]
[FONT=Verdana]while [ -f \"${file%.*}$sep$i$ext\" ];[/FONT]
[FONT=Verdana]do[/FONT]
[FONT=Verdana] i=$(( $i+1 ));[/FONT]
[FONT=Verdana] sep=\" \";[/FONT]
[FONT=Verdana]done;[/FONT]
[FONT=Verdana]mv \"$downloadFile\" \"${file%.*}$sep$i$ext\";"[/FONT]
[FONT=Verdana] [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana] [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana] [B]end[/B] [B]tell[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000] [B]end[/B] [/COLOR][B]perform mail action with messages[/B][/FONT][/COLOR]
[FONT=Verdana][B]end[/B] [B]using terms from[/B][/FONT]