Below I have a partial script. The script creates an untitled document and adds some text to it. All I need it to do is save the document as the name "mydocument.txt" on the desktop, but the applescript dictionary seems to be leading me astray.....or maybe I just am an idot (probably true). Any help?
Code:
make new document
end if
set the text of the front document to theText
save as "mydocument.txt" in "Macintosh HD:Users:John:Desktop"
quit application "TextEdit"
end tell