Apple script-How to assign a variable from reading a file content and to send a message?
One possible cause of that error is the POSIX pathname, "/Users/human/macairspace.txt" is not correct; however, that is not the only thing wrong with your code:

Without going into details about what else is wrong, let be show you an example of how I'd code it, and this works for me when I replace "+nnnnnnnnnnn" and "/path/to/file.txt" with valid values.

Example AppleScript code:

set targetBuddy to "+nnnnnnnnnnn"
set textMessage to (read POSIX file "/path/to/file.txt")

tell application "Messages"
    set targetService to id of 1st service whose service type = iMessage
    set theBuddy to buddy targetBuddy of service id targetService
    send textMessage to theBuddy
end tell




Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the used to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.