Get text of document to email?

I’m trying to setup a script to grab the text of a document in TextEdit and place it into an email in Mail.

tell application "TextEdit"
	open "/email_unsub.tab"
	tell the front document
		set eText to document
	end tell
end tell
tell application "Mail"
	set theNewMessage to make new outgoing message with properties {content:eText, visible:true}
end tell

Again, I’m quite sure there is a simple answer. I’m pretty new, and still wrapping my head around the ways of the AppleScript.

Hi,

if the text file is a plain text file, there is a shortcut


set theText to read file ((path to startup disk as text) & "email_unsub.tab")
tell application "Mail"
	set theNewMessage to make new outgoing message with properties {content:theText, visible:true}
end tell

That worked great! Thanks.

Pulling from a plaintext doc like that is certainly a useful tidbit.