I have a script which makes a mail with Cocoa and I want to change the sender of the mail, before sending it. I have multiple account, and the CoCoa takes always the active account.
Now I have a script using the "System Events", but I'm not very happy with it, because it isn't users proof. If a user presses on a key when the script is running, everything runs haywire...
My script so far is:
What can I do to improve this?
Now I have a script using the "System Events", but I'm not very happy with it, because it isn't users proof. If a user presses on a key when the script is running, everything runs haywire...
My script so far is:
Code:
tell application "System Events"
tell process "Mail"
click pop up button 1 of window 1
delay 0.5
click menu item 9 of menu 1 of pop up button 1 of window 1
end tell
end tell
What can I do to improve this?