Ordneraktion zum Versenden von Mails möglich?

  • Ersteller holgerfriedrich
  • Erstellt am
H

holgerfriedrich

Neues Mitglied
Thread Starter
Dabei seit
10.05.2005
Beiträge
6
Reaktionspunkte
0
Ich bin neu am Mac und habe mal eine Frage, ob sich folgende Aufgabe mit einer Ordneraktion/Script lösen lässt (vielleicht gibt es die ja auch schon fertig irgendwo)

Ich möchte einen Ordner haben, der die Inhalte an eine bestimmte E-Mail-Adresse sendet. Danach sollen die Dateien in diesem Ordner in den Ordner "Gesendet" verschoben werden.

Würde mich freuen, wenn jemand helfen kann.
 
Ich habe in einem früheren Thread hier dazu mal ein paar Sachen beschrieben. Passt zwar nicht so ganz 100%ig auf Dein Problem, aber mit etwas "Transferdenken" kommst Du wahrscheinlich recht weit.
 
Wenn Du Tiger hast, kannst Du Dir sowas schnell mit Automator zusammenklicken und als Plugin > Ordneraktion sichern.
 
holgerfriedrich schrieb:
...Ich möchte einen Ordner haben, der die Inhalte an eine bestimmte E-Mail-Adresse sendet....

Einen ersten Ansatz zur Lösung bietet das folgende Script das ich mal irgendwo gefunden habe, und leider den Autor nicht mehr herausfinden kann. Hoffe es ist o.k.

Code:
(* Dieses Script überwacht einen beliebigen Ordner auf neue Dateien und sendet diese an eine einzutragende Emailadresse. Versandte Dateien werden mit einem roten Etikett versehen *)


--Wurden neue Dateien hinzugefügt?


on adding folder items to this_folder after receiving added_items
	
	
	
	--Variablen definieren für den e-mailversand
	
	
	set theSubject to "Test"
	set theContent to "Test"
	set theSenderAdress to "ab@sender.de"
	set theRecipient to "Test"
	set theRecipientAdress to "em@pfaenger.de"
	
	
	if class of added_items is not list then
		set added_items to added_items as list
		
	end if
	
	
	--für jede Datei wird eine neue e-mail generiert
	
	
	repeat with theAttachment in added_items
		
		
		tell application "Mail"
			set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent & return & return}
			
			tell newMessage
				set visible to false
				set sender to theSenderAdress
				make new to recipient at end of to recipients with properties {name:theRecipient, address:theRecipientAdress}
				
				tell content
					make new attachment with properties {file name:theAttachment} at after the last paragraph
				end tell
				
				activate
				send newMessage
				
			end tell
		end tell
		
		
		
		--gesendete Dateien werden mit einem roten Etikett versehen      
		
		
		
		tell application "Finder"
			
			set chosenLabel to "2 (red)"
			set labelIndex to word 1 of chosenLabel as integer
			set labelColor to word 2 of chosenLabel as string
			set label index of theAttachment to labelIndex
		end tell
		
		
	end repeat
	
	
end adding folder items to

Du musst Dir das halt Deinen Bedürfnissen entsprechend umbauen, aber der Ansatz sollte schon mal helfen.
Ich benutze das Script in Kombination mit einem weiteren das die Inhalte von Mails nach bestimmten Kriterien kontrolliert, dann das obige Script startet, bzw. in den Ordner an den das Script angehängt ist Dateien reinpackt und mir so ganz bequem fast automatisch zuschickt.

Grüße,
Flo
 
Hab mal folgendes Skript gefunden, das als Ordneraktion eines Ordners läuft.
Der Ordner hat den Namen der email-Adresse, an den die Datei, die in den Ordner abgelegt hat, verschoben wird. Also z.B. irgendwer@nirgendwo.uk.
Ist auf Entourage eingestellt, müßte eventuell an Mail angepaßt werden.

Code:
-- Copyright Sam Griffith Jr.
-- stayypufd@mac.com
-- 
-- To use this script, attach it to a Folder, then name that folder with the email address of whom you
-- want the item dropped into the folder to be mailed to.  So for example, if you wanted to mail me the
-- image, you'd name the folder staypufd@mac.com.

property toPerson : ""
property subjectName : ""

on adding folder items to this_folder after receiving added_items
	--delay 10
	
	repeat with each in added_items
		
		tell application "Finder"
			set the toPerson to the name of this_folder
			set subjectName to the name of each
		end tell
		
		tell application "Microsoft Entourage"
			activate
			
			set msg to (make new outgoing message at the outbox folder with properties ¬
				{recipient:{address:{display name:toPerson, address:toPerson}, recipient type:to recipient}, attachment:{file:each}})
			-- set the subject of msg to "ABC Subject"
			set the subject of msg to subjectName
			set the content of msg to "Hope you like this picture!"
			
			-- Choose one of these depending on whether you want the script to go out right away or later
			send msg with sending later
			--send msg
			
		end tell
		
		-- Hide the mail app 
		tell application "Finder"
			set procs to processes
			repeat with y in procs
				set procName to the name of y as string
				if procName is equal to "Microsoft Entourage" then
					set the visible of process named "Microsoft Entourage" to false
				end if
			end repeat
		end tell
	end repeat
	
end adding folder items to

Der Link zum Original bei ScriptBuilders: http://scriptbuilders.net/files/emailimages1.2.html

Manfred
 
Zuletzt bearbeitet:
Zurück
Oben Unten