Compose an email with AppleScript

I have recently committed to send every Friday an update email to someone at work. Few lines need change from week to week. I have written a simple AppleScript script to help me do it.

set recipientName to "John Snow"
set recipientAddress to "jsnow@gameofthrones.example"
set theSubject to "Winter is Comming"
set theContent to "Hi 

I have seen white walkers in the following spots: 



tell application "Mail"
    set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
    tell theMessage
        make new to recipient with properties {name:recipientName, address:recipientAddress}
    end tell
end tell

Not every detail of the email is completely automated. Hence, I need to fill some details before clicking send.

If you have every detail ready, you can send the emails directly from AppleScript with the send keyword.

Tags: #automation #applescript
Aug 2021, 02.


My next events:
🗓 Jul 20 09:00 Workshop Security in the Micronaut Framework
🗓 Sep 20 09:00 JCON Online 2022 - Getting Started with the Micronaut Framework
🗓 Sep 23 09:00 JCON Online 2022 - Micronaut® Framework and Microstream Java-native persistence engine