1

Here's a simple AppleScript for creating and sending messages.

tell application id "com.apple.mail"
    repeat with i from 1 to 5
        set newMessage to make new outgoing message at ¬
            end of outgoing messages with properties ¬
            {visible:false, subject:"Message " & i}
        tell newMessage to make new ¬
            to recipient at ¬
            end of to recipients with properties ¬
            {name:"Ralph", address:"ralph@sosad.org"}
        send newMessage
    end repeat
end tell

If executed in debug mode, the visibility of the outgoing messages behaves as expected, i.e., they're composed and sent invisibly and are never seen at all.

However, when saved as an application and executed, "make new outgoing message" causes each message to be momentarily visible, blinking into existing and then vanishing in a way likely to induce seizures in the susceptible. The work gets done, but the user is left with a migraine.

I'd really like to make this behave. I'm running OS X 10.11.1.

You must log in to answer this question.

Browse other questions tagged .