Problem attaching file to mail message

Here is what I have, mostly courtesy of Stephan K (thank you)

set the_subject to “Huddle”
set the_file to ((path to documents folder as text) & “huddle.doc”)
tell application “Mail”
set new_message to make new outgoing message with properties {subject:the_subject, content:"Open file and delete excess white space to make it fit on one page before printing.

  ", visible:true}
tell new_message
	make new to recipient at end with properties {address:"drmjdoyle@gmail.com"}
	make new attachment at end of first paragraph of content with properties {file name:the_file}
end tell
-- send new_message

end tell

Even though the file exists in the documents directory, it does not get attached to the message. I am not sure why this fails.

I figured it out! Needed to add as alias after the file name. Works ok now.

Hi,

the argument of file name must be an alias


set the_subject to "Huddle"
set the_file to ((path to documents folder as text) & "huddle.doc")
tell application "Mail"
	set new_message to make new outgoing message with properties {subject:the_subject, content:"Open file and delete excess white space to make it fit on one page before printing.
    
      ", visible:true}
	tell new_message
		make new to recipient at end of to recipients with properties {address:"drmjdoyle@gmail.com"}
		tell content to make new attachment at after first paragraph with properties {file name:the_file as alias}
	end tell
	-- send new_message
end tell