Links on sending/receiving imessages with applescript or bash

https://apple.stackexchange.com/questions/331468/bash-script-detect-received-imessage-along-with-its-contents

Command line program to send imessage messages
https://github.com/linjunpop/imessage

Chat bot
https://github.com/ZekeSnider/Jared

Run bash commands from Applescript
https://www.cyberciti.biz/faq/mac-osx-applescript-run-shell-script/

Applescript Documentation archive
https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html