Greetings,
I have a question regarding AppleScript. I tried, but I am plainly too uninspired to get it right.
Objective: In Mac OS X Mail, when I click on "Compose new message" I want an AppleScript to run that prompts me to select an SMTP server. The basics I got right, the following script works, but how do I tie it to "Compose new message"?
on run
set myResult to display dialog ¬
"Sending e-mail to Xyz?" buttons {"Yes", "No"}
tell application "Mail"
if the button returned of myResult is "Yes" then
set smtp server of account "ABCD" to ¬
smtp server "XYZ"
else
set smtp server of account "ABCD" to ¬
smtp server "DEFG"
end if
end tell
end run
Would be very grateful for some guidance.
Cheers!
I have a question regarding AppleScript. I tried, but I am plainly too uninspired to get it right.
Objective: In Mac OS X Mail, when I click on "Compose new message" I want an AppleScript to run that prompts me to select an SMTP server. The basics I got right, the following script works, but how do I tie it to "Compose new message"?
on run
set myResult to display dialog ¬
"Sending e-mail to Xyz?" buttons {"Yes", "No"}
tell application "Mail"
if the button returned of myResult is "Yes" then
set smtp server of account "ABCD" to ¬
smtp server "XYZ"
else
set smtp server of account "ABCD" to ¬
smtp server "DEFG"
end if
end tell
end run
Would be very grateful for some guidance.
Cheers!
Last edited: