AppleScript sending Mail messages before file attachments are attached in El Capitan I have a Workflow that runs an AppleScript which attaches spam emails as file attachments and sends them to ASSP for processing.

It's been working fine, but apparently something has changed in El Capitan's Mail or one of the subsequent updates which has caused it to stop working. I just noticed that the sent mail messages do not have any attached files anymore. 

tell application "Mail"
    set theNewMsg to make new outgoing message with properties {subject:theReportSubject, visible:true}
    tell theNewMsg
        make new to recipient at end of to recipients with properties {address:theAddress}
        make new attachment at after the last paragraph with properties {file name:theTempFileName}
        send
    end tell
end tell
One workaround is adding a delay prior to send — in my case a delay 1 works but .5 would not, but found elsewhere people that were able to do .2, so experiment to see what works for you:

tell application "Mail"
    set theNewMsg to make new outgoing message with properties {subject:theReportSubject, visible:true}
    tell theNewMsg
        make new to recipient at end of to recipients with properties {address:theAddress}
        make new attachment at after the last paragraph with properties {file name:theTempFileName}
        delay 1
        send
    end tell
end tell