Creating a new message and autodialing text from clipboard

I hope one of the AppleScript Pros can help with this command. I’m trying to run a script to create a new text message on my MacBook Pro’s Messages App, and paste information from clipboard, like phone, name and address. The phone number should be pasted to the “To” field. And the message will be “Hello Name, I’m reaching out about Address, which was listed for Price”

I asked Chat GPT to create this script, and it was able to generate it half way. It’s able to put the phone number in the right place, and write Hello. But it’s not able to get the name from the 3rd line, address from the 1st line, and Price from the 4th line of the clipboard.

The format in the clipboard is like this

123 Main St
John Doe

Please see the scpt file attached.

If the script isn’t very long, you could post the actual code here.

Without seeing your code, I can say that you should be able to use “paragraphs of” to parse that return-delimited text into a list, then set variables to each relevant item in the list. Then, you could build up the message you want.