Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Photo Booth Picture as attachment for mail?

5 views
Skip to first unread message

Heiko Warnken

unread,
Dec 4, 2014, 7:37:46 AM12/4/14
to
Hallo Leute,

ich versuche mich gerade an ein Applescript. Mittels Photo Booth soll
ein Fotoaufgenommen und sofort als Anhang an eine neue eMail gehängt werden.
Leider funktioniert das nicht, wie erwartet.
Das Foto wird mit Photo Booth erstellt und es befindet sich auch im
Container mit den gemachten Photo Booth Bildern. Es wurde also korrekt
gespeichert.
In der Variablen "FotoDirectory" steht der Pfad zu dieser neu erstellten
Datei "Pictures/Photo Booth-Mediathek/Pictures!

Die Fotodatei wird vom Script auch gefunden, zumindest gab es keine
Fehler im Protokoll im Scripteditor.
Dennoch wird die Datei nicht an eine neue eMail angefügt. Und hier würde
mich interessieren, warum das so ist, wo der Fehler liegt. Denn selbst
an der Stelle, an der das Foto angefügt wird, erscheint im
Scripteditor-Protokoll keine Fehlermeldung. Es sieht ganz so aus, als
würde das Foto gespeichert, aber gar nicht an die eMail angefügt, es
wird nichteinmal der Versuch gemacht.

Kann mir jemand auf die Sprünge helfen? Zur Veranschaulichung hier mal
mein Script ...

tell application "Photo Booth"
activate
delay 2
tell application "System Events"
tell process "Photo Booth"
delay 2
keystroke return using command down
delay 6
end tell
end tell
end tell
tell application "Photo Booth"
quit
end tell
set FotoDirectory to "~/Pictures/Photo Booth-Mediathek/Pictures/"
set CurrentDate to current date
set CurrentDay to text -2 thru -1 of ("0" & CurrentDate's day)
set CurrentMonth to text -2 thru -1 of ("0" & ((month of CurrentDate) * 1))
set CurrentYear to text -2 thru -1 of ((year of CurrentDate) as text)
set CurrentHour to text -2 thru -1 of ("0" & CurrentDate's hours)
set CurrentMinute to text -2 thru -1 of ("0" & CurrentDate's minutes)
set Datei to FotoDirectory & "Foto am " & CurrentDay & "." &
CurrentMonth & "." & CurrentYear & " um " & CurrentHour & "." &
CurrentMinute & ".jpg"
set Datei to quoted form of POSIX path of Datei
--- Bis hier her funktioniert alles zuverlässig

set subject to "Facepic von mir"
set body to "Hier ist ein Facepic von mir. Es ist nur ein paar Minuten
alt."

tell application "Mail"
set NewMessage to make new outgoing message with properties
{subject:subject, content:body & return & return, visible:true}
tell NewMessage
set visible to true
try
make new attachment with properties {file name:Datei}
on error ermess
display alert "Fehler: " & errmess buttons {"Ok"}
end try
end tell
end tell

Problem: Es gibt keine Fehlermeldung, aber auch nicht den Anhang in der
eMail.
Der Pfad ist definitiv korrekt.
Photo Booth erstellt eine Datei mit dem Namen "Foto am 04.12.14 um
13.47.jpg"
Der Pfad zu dieser Datei lautet laut Variableninhalt "Datei":
":~:Documents:Pictures:Photo Booth-Mediathek:Pictures:Foto am 03.12.14
um 13.47.jpg"
Aber eben jene Datei wird in der Mail App nicht eingefügt.

Gruß
Heiko
0 new messages