• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Die Bildungsoffensive hier im Forum geht weiter! Jetzt sollen Kreativität und technische Möglichkeiten einen neue Dimension erreichen. Das Thema in diesem Monat lautet - Verkehrte Welt - Hier geht es lang --> Klick

Mail Script mit attachment

  • Ersteller Ersteller elroberto
  • Erstellt am Erstellt am

elroberto

Gast
Ich möchte gerne mit Automator oder Applescript ein Attachment per Mail schicken.
Das Attachment muss aber im Textteil reinkopert werden. Gibt es hier schon fertige scripts?

Kann man dies auch zeitgesteuert machen?

lg
elroberto
 
Was meinst du mit "im Textteil reinkopert werden"?

Wenn du die Datei(?) auf das Mail Icon im Dock ziehst, wird die Datei in den "Textteil" der zu verfassenden eMail kopiert. Ist es das was du willst?
 
Ich möchte den Inhalt des Attachment (ist eine .txt Datei) in das mail reinkopieren.
z.b. ich habe eine test.txt datei in dieser datei steht: blablabla. Dann möchte ich das im mail blablabla steht (so wie es in der txt-datei formatiert ist).
Wenn ich die Datei auf mail ziehe, wird es als attachment angezeigt.

lg
elroberto
 
Hi elroberto!

So würde das mit dem Erstgenannten gehen:



wenn Du es als Plug-In für das Skript-Menü oder besser gleich als iCal Erinnerung speicherst, kannst Du es mit iCal auch "zeitgesteuert" ausführen lassen…

Gruss


 
Gibt es auch die Möglichkeit eines Entourage Scripts welches dieses Problem löst?
Gibts da schon ein Besipielscript?
 
Schon probiert in dem Automator Plugin von space in Schritt 2 bei "Oeffnen mit:" anstatt Standardprogramm Entourage auszuwaehlen?
 
Geht leider nicht. Gibt es vielleicht Entourage-Automator-plugins?
Habe nun ein Mail-Applescript geschrieben:
tell application "Mail"
set newMessage to make new outgoing message
tell newMessage
set visible to true

set subject to "Kunde x"
set sender to "[email protected]"
set attached_file to "/HelpmeROB/OSX Tools/ scripts/firstclass/adressen-bwm.txt"

make new to recipient at end of to recipients with properties {name:"Audit", address:"[email protected]"}

tell content
make new attachment with properties {file name:attached_file} at after the last word of the last paragraph
end tell
send
end tell
end tell

Das Script funktioniert. Ich möchte aber nun den Inhalt des Attachments in das Mail kopieren (wie bei den Automatorscript von space)
 
Zuletzt bearbeitet von einem Moderator:
Hallo!

Bei mir funktioniert das Anhängen des Files nicht.
wie muss der Pfad eigentlich angegeben werden?

~/desktop/Bild.jpg
und...
Users/Hans/desktop/Bild.jpg

...funktionieren nicht bzw ist das überhaupt das Problem

LG Hans
 
@elroberto
Nein, es gibt keine Entourage Automator Actions.
Die verstehen sich nicht.

Auslesen per AS
Code:
tell application "Finder"
	set theFile to "Macintosh HD:Pfad:zu:adressen-bwm.txt"
	set x to open for access file theFile
	set Inhalt to read x
	close access x
	
	tell application "Mail"
		set newMessage to make new outgoing message
		tell newMessage
			set visible to true
			
			set subject to "Kunde x"
			set sender to "[email protected]"
			
			set content to Inhalt
			
		end tell
	end tell
end tell


[…]...funktionieren nicht bzw ist das überhaupt das Problem

Der Pfad muss der Pfad ab der Festplatte gesetzt werden. In AppleScript mit : getrennt.
Also z.B.
Code:
Macintosh HD:Users:Hans:Desktop:Bild.jpg


Gruss
 
Hallo space!

mail bindet mit deinem script die bild-daten anscheinend in den TEXT ein. sehe nur buchstaben und zeichengewirr im text aber kein angehängtes file :-(
-->ah, hab grad gsehn dass dein script ein text file in den inhalt einbindet
-->ich hab ein bild (jpeg) ... gibt es hier auch eine möglichkeit?

der vorschlag von elroberto (mit dem attached file) funktioniert bei mir auch nicht (trotz : im pfad)

lg Hans
 
Code:
tell application "Mail"
	set this_message to make new outgoing message at beginning of outgoing messages
	tell this_message
		set visible to true
		make new to recipient at beginning of to recipients with properties {address:"[email protected]", sender:"[email protected]"}
		set subject to "Betreff der Mail"
		set content to "Textinhalt der Mail"
		set anhang to "macintosh hd:users:hans:desktop:bild.jpg" as alias
		--set anhang to (choose file) ...alternative Fileauswahl
		make new attachment with properties {file name:anhang} at after last paragraph
		send
	end tell
end tell

Lg Hans
 
Habe deinen Post gestern nicht gelesen…
aber jetzt hast Du ja ein funktionierendes Script :-)

Gruss