Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
cleany •->

Anmeldedatum: 30.06.2003 Beiträge: 5
|
Verfasst am: 05.09.2003 - 18:04 Titel: e-Mail generieren mit Attachment für Mail.app |
|
|
Ich habe zwei einfache Applescripts gemacht, mit dehen man e-mails mit Attachment in Mail.App erstellen kann.
Ich hoffe, dass jemand das gebrauchen kann
Code: |
--Applescript um eine e-mail mit Dateianhang mit Mail.app zu senden
--diese Version öffnet eeinen Dialog um die entsprechende Datei anzugeben
--die Empfänger e-mail Adresse und Name (Name optional)
-- wird dargestellt als "SomeOne <someone@somewhere.com>"
set theName to "SomeOne"
set theAddress to "someone@somewhere.com"
-- der Text für die Betreff-Zeile
set theSubject to "Mail Subject"
--der Text für den Textbereich
set theBody to "Body Text"
-- hier holen wir den Pfad zur Datei per Dialog
set fileAttachThis to choose file
--das Resultat kommt als fileAttachThis zurück, umwandeln in eine Liste
set fileList to {fileAttachThis}
-- nur das erste Element in der Liste nehmen
set theAttachment to first item of fileList as alias
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
end tell
activate
end tell
|
Code: |
--Applescript um eine e-mail mit Dateianhang mit Mail.app zu senden
--diese Version benötigt einen Dateipfad zum Dateianhang
--die Empfänger e-mail Adresse und Name (Name optional)
-- wird dargestellt als "SomeOne <someone@somewhere.com>"
set theName to "SomeOne"
set theAddress to "someone@somewhere.com"
-- der Text für die Betreff-Zeile
set theSubject to "Mail Subject"
--der Text für den Textbereich
set bodyText to "Your Image" & return & return as international text
-- der UNIX Pfad zur Datei die mitgesendet werden soll
-- UserName natürlich mit dem richtigen UserName und Bild 1.pdf natürlich mit den entsprechenden Dateinamen ersetzen
set theAttachment to ("/Users/UserName/Desktop/Bild 1.pdf" as POSIX file) as alias
tell application "Mail"
set newMessage to make new outgoing message
tell newMessage
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
set subject to theSubject
set content to bodyText
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
set visible to true
end tell
activate
end tell
|
Gruss Markus Reinhard |
|
Nach oben |
|
 |
airjump •->

Anmeldedatum: 30.11.2004 Beiträge: 8 Wohnort: Gelsenkirchen
|
Verfasst am: 30.11.2004 - 14:02 Titel: Re: e-Mail generieren mit Attachment für Mail.app |
|
|
Hallo Markus Reinhard
Super, habe ich auch gleich mal ausprobiert und angepasst.
Ja aber kann mann das senden auch automatisieren?
Ich bräuchte die Funktion das die Email nicht nur erstellt wird sondern auch abgeschickt wird.
Nochmal das Scriopt finde ich super gut.
cleany hat Folgendes geschrieben: | Ich habe zwei einfache Applescripts gemacht, mit dehen man e-mails mit Attachment in Mail.App erstellen kann.
Ich hoffe, dass jemand das gebrauchen kann
Code: |
--Applescript um eine e-mail mit Dateianhang mit Mail.app zu senden
--diese Version öffnet eeinen Dialog um die entsprechende Datei anzugeben
--die Empfänger e-mail Adresse und Name (Name optional)
-- wird dargestellt als "SomeOne <someone@somewhere.com>"
set theName to "SomeOne"
set theAddress to "someone@somewhere.com"
-- der Text für die Betreff-Zeile
set theSubject to "Mail Subject"
--der Text für den Textbereich
set theBody to "Body Text"
-- hier holen wir den Pfad zur Datei per Dialog
set fileAttachThis to choose file
--das Resultat kommt als fileAttachThis zurück, umwandeln in eine Liste
set fileList to {fileAttachThis}
-- nur das erste Element in der Liste nehmen
set theAttachment to first item of fileList as alias
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
end tell
activate
end tell
|
Gruss Markus Reinhard |
Kann ich din die Subject Line auch eine Variable einfügen?
Gruß
Markus Zielonka |
|
Nach oben |
|
 |
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
Powered by phpBB © 2001, 2002 phpBB Group Deutsche Übersetzung von phpBB.de
|
|
|