I'm having trouble creating an applescript to do a "save as html" on the front-most TextEdit document, and save it to the same directory (same name, just add an "html" extension....which I assume would be default behavior anyway).
My understanding is that it ought to use textutil to do this.
For extra polish and gratitude: could it check to see if a file with same name and extension already exists in that directory, and, if so, automatically renames the saved HTML file ala "xxxx2.html"?