Saving Text view contents as Text file

Hi People.
After Jobu helped me - I got a new window and it contains the text it should.
Now the problem is to Save it.
I wrote this code but nothing came of it.
No file was created any where.

on saveReport(reportContents)
	tell save panel
		set thetext to the contents of reportContents as text
		set title to "Save missing coupons as text file"
		set theFileName to "Missing coupons" & windowCount & ".txt"
	end tell
	display save panel with file name theFileName
	set textfilepath to path name of save panel as string
	save thetext in file textfilepath as Unicode text
end saveReport

thank you…