Hi, and happy new year to you all.
I’m trying to automate sending a monthly newsletter to clients, but I can’t get Mail to actually send it. Basically, I’ve used gui scripting to get Safari to open a web page and ‘press’ command and i. Then I’ve told Mail to Bcc to ‘Group 1’ and then keystroke return to set the addresses (and the process will repeat for all client groups in address book, but that’s where it falls over. The email is ready to send, but I can’t applescript the Send Mail (Command + Shift + D).
The script is basically as follows:
Tell application Safari
open location “http://www.domain.com”
tell application “system events”
keystroke i using command down
– this opens the web page and ‘sends’ it to Mail
tell application “mail”
activate
tell application “system events”
keystroke tab
keystroke tab
keystroke “Group 1”
keystroke return
– Mail then tabs down to the bcc field and sets it to Group 1 of the mailing list –
And now I want to tell Mail to send the email, and then repeat the process for Groups 2 and 3, etc.
Any help with this (and refinement tips) most gratefully accepted.
Cheers,
Kev.