Vielen Dank, leider klappt das hier nicht so richtig.

Ich habe nun folgenden Code:

Show Plain Text
  1. tell application "Mail"
  2.   set newMessage to make new outgoing message with properties {visible:true, subject:"hans@wurst.de", content:"Nix als Laberei"}
  3.   tell newMessage
  4.     make new to recipient at end of to recipients with properties {name:"Paul", address:"paul@klee.de"}
  5.   end tell
  6.   close front window
  7. end tell
  8.  
  9. delay 0.5
  10.  
  11. tell application "System Events"
  12.   tell process "Mail"
  13.     if exists sheet 1 of window 1 then
  14.       click defaultbutton of sheet 1 of window 1
  15.     end if
  16.   end tell
  17. end tell


Das Fenster wird leider nicht geschlossen. Nicht mit "defaultbutton" und auch nicht mit button 0 bis 3.

Vielen Dank für Deine Mühe, Stefan. Das muss jetzt auch ohne gehen Die generierten Mails sollen sowieso abgeschickt werden. Es wäre einfach nur schöner gewesen.
Das kann jetzt auch erstmal so bleiben, ohne Fenster zu.

Viele Grüße
Udo
----------
Danke und Tschüß
Udo