I wanted to make a little script involving messages on my Mac and after some research I discovered it was indeed possible. The only problem is that the "AppleScript handler" option in Messages>Preferences>General is missing for me. This very option is listed right on the Apple website under the High Sierra heading.
This is what I'm expecting:
But this is all I see:
For what it's worth I'm running 10.13.4 Beta (17E160e). Is it possible that this feature has been removed?