I'm hoping to programmatically send files via imessage, yet cannot figure out how to send a file object via the API.
This script send a message to a specified user with the file path:
imessage() {
file="$PWD/$2";
osascript -e 'tell application "Messages" to send '\"$file\"' to buddy '\"$1\"';
}
How can I send the actual file? A pointer to the docs for this would also be helpful.