Hi there,
I’m just having a bit of difficulty trying to get the mail.app to switch smtp servers.
tell application "Daylite"
activate
end tell
tell application "System Events"
key code 15 using {command down, shift down}
tell process "Daylite"
select row 49 of outline 1 of scroll area 1 of splitter group 1 of sheet 1 of window 1
click button 3 of sheet 1 of window 1
click button 3 of sheet 1 of window 1
tell window "Print"
--click pop up button 5
--click menu item "Standard" of menu 1 of pop up button 5
--click button 1
click menu button 1
click menu item "Mail PDF" of menu 1 of menu button 1
tell application "Mail"
set theSubject to "My current projects"
set theMessage to "My current projects"
repeat until ((name of window 1) is "New Message")
end repeat
delay 1
set NewMessage to (outgoing message 1) -- Targets the front most 'Mail' window for the following actions.
tell NewMessage
set visible to true
make new to recipient at end of to recipients with properties {address:"boss@company.com"}
--set sender to "me@company.com"
tell application "Mail" to set smtp server of "CompanyAccnt" to server name "mail.company.com"
set subject to theSubject
set content to theMessage
end tell
end tell
activate
end tell
set frontmost to true
delay 1
keystroke tab
delay 1
keystroke tab
delay 1
click button 1 of sheet 1 of window 1
end tell
end tell
This code calls the application “Daylite” to get a report, then brings up the print dialog window, then click the ‘Mail PDF’. Once that is done, I’m having trouble changing the frontmost window to a different smtp server and changing the signature too. I’m trying not to do this via GUI. Any suggestions?
Cheers