jodomac39
Aktives Mitglied
Thread Starter
- Dabei seit
- 20.01.2004
- Beiträge
- 144
- Reaktionspunkte
- 8
Gruß zum Sonntag mit einer Frage:
Ein applescript, das mehrere Emails aussucht und als PDF-Files abspeichert, produziert eine Dialog Box, wenn das PDF-File schon am Speicherort existiert, läuft aber weiter!
Ein error wird dadurch nicht produziert (try on error end try )
Wie kann ich die Dialog Box abfangen, um das PDF-File woanders zu speichern?
Ein applescript, das mehrere Emails aussucht und als PDF-Files abspeichert, produziert eine Dialog Box, wenn das PDF-File schon am Speicherort existiert, läuft aber weiter!
Ein error wird dadurch nicht produziert (try on error end try )
Wie kann ich die Dialog Box abfangen, um das PDF-File woanders zu speichern?
Code:
tell application "System Events"
tell process "Mail"
open item x of Auswahl_X
set frontmost to true
delay 1
keystroke "p" using {command down}
delay 1
repeat until exists sheet 1 of window 1
delay 0.5
end repeat
tell sheet 1 of window 1
click menu button 1 of group 2 of splitter group 1 -- PDF
delay 5
click menu item 2 of menu 1 of menu button 1 of group 2 of splitter group 1 -- "Als PDF sichern…"
delay 2
keystroke "v" using {command down} -- Filename einsetzen
delay 2
try
key code 76 -- 'Enter' auf Nummernblock
on error the_error_message
display dialog the_error_message
end try
delay 5
keystroke "w" using {command down} -- Mail schließen
delay 5
end tell
end tell
end tell