Mit Applescript PDF-Datei an Automatorprogramm übergeben

S

schau.hans

Aktives Mitglied
Thread Starter
Dabei seit
09.01.2006
Beiträge
511
Reaktionspunkte
21
Hallo,

ich habe ein Automatorprogramm was mir meine PDF Files aufbereitet und anschließend ausdruckt sobald ich eine PDF Datei mit der Maus drauf ziehe.
Das funktioniert auch soweit.

Ich möchte nun mittels Mailregel die PDF Files von bestimmten Mails an das Automatorprogramm übergeben und ausführen lassen.
Hoffe ihr könnt mir helfen.

Danke

Hier die Script in Mail:
Code:
using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		tell application "Mail"
			--set theFolder to (POSIX path of (path to temporary items))
			set theFolder to (POSIX path of ("Macintosh HD:Users:Hans:Desktop:"))
			repeat with theMessage in theMessages
				set theSender to the sender of theMessage
				repeat with theAttachment in mail attachments of theMessage
					try
						HIER DAS theAttachment AN DAS AUTOMATORPROGRAMM ÜBERGEBEN UND AUSFÜHREN
					end try
				end repeat
			end repeat
		end tell
	end perform mail action with messages
end using terms from
 
Sollte so gehen:

Code:
[B]tell [/B][COLOR=#0433FF][FONT=Verdana][I]application[/I][/FONT][/COLOR][FONT=Verdana] "Finder" [/FONT][B]to [/B][COLOR=#0433FF][FONT=Verdana][B]open[/B][/FONT][/COLOR][FONT=Verdana] {[/FONT][COLOR=#4F8F00][FONT=Verdana]Anhang1[/FONT][/COLOR][FONT=Verdana], [/FONT][COLOR=#4F8F00][FONT=Verdana]Anhang2[/FONT][/COLOR][FONT=Verdana]} [/FONT][COLOR=#0433FF][FONT=Verdana]using [/FONT][/COLOR][COLOR=#0433FF][FONT=Verdana][I]alias[/I][/FONT][/COLOR][FONT=Verdana] ":Pfad:zum:Droplet.app"[/FONT]
 
Danke, hat aber leider nicht funktioniert.

Code:
using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		tell application "Mail"
			repeat with theMessage in theMessages
				repeat with theAttachment in mail attachments of theMessage
					try
						tell application "Finder" to open {theAttachment} using alias "Macintosh HD:Users:Hans:Documents:Dropbox:Gärtnerei:Ausdruck_Bella_Lieferschein_Droplet.app"
					end try
				end repeat
			end repeat
		end tell
	end perform mail action with messages
end using terms from
 
Das dürfte daran liegen, dass du ein mail attachment übergibst, keine Datei. Du musst den Anhang (falls noch nicht geschehen) erst herunterladen und irgendwo speichern, dann kannst du die gesicherte Datei an dein Droplet übergeben.
 
  • Gefällt mir
Reaktionen: schau.hans
Danke das wars.
Das File wird jetzt kurz gespeichert, bearbeitet und anschließend wieder gelöscht.
 
Zurück
Oben Unten