Here is a way to take the screenshot from the clipboard and send it in Messages.
Example AppleScript code:
if ((clipboard info) as string) contains JPEG picture then
set jpgData to the clipboard as JPEG picture
set fileName to "/tmp/IMG_" & (random number from 1000 to 9999) & ".JPG" as string
set thisFile to open for access POSIX file fileName with write permission
write jpgData to thisFile
close access thisFfile
close access thisFile
set theTime to time string of (current date)
set thePicture to POSIX file fileName as alias
tell application "Messages"
set iMessageService to 1st service whose service type = iMessage
set imessagebuddy to buddy "[email protected]" of iMessageService
send theTime to imessagebuddy
send thePicture to imessagebuddy
tell application "System Events"
delete alias fileName
Note: The example AppleScript code is just that and does not employ any other error handling then what's shown and is meant only to show one of many ways accomplish a task. The onus is always upon the User to add/use appropriate error handling as needed/wanted.