Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

TextEdit keeps saving .html file as .txt

As you know, you don't "save as..." files in Lion - Lion-compatible applications save a copy, and you don't get to specify what extension you want. So... I have all the proper preferences checked for TextEdit to properly open and manage .html documents ("ignore rich text commands in html files" is checked, "add .txt extension to plain text files" is unchecked. But every time I edit and then save an html source file, TextEdit changes the extension from .html to .txt. I've tried closing and opening the file again, both from the Finder and from TextEdit, and I see the same behavior. I can't figure out any way to keep the .html extension from within the appication - I always have to find the file in the Finder and manually change the extension back to .html after every time I edit it. Does anyone know how to fix this?

Posted on Aug 21, 2011 9:53 PM

Reply
Question marked as Best reply

Posted on Aug 21, 2011 10:25 PM

Edit your document in rich text. When you first save it there will be pull-down menu to choose html. Saves after that behave properly and don't eat the html extension. For some reason TextEdit persists in changing html documents done in plain text to a txt extension.

16 replies

Aug 24, 2011 3:14 PM in response to aaxe

That's odd. I just double checked. This time I created the document in plain text and saved it with an html extension. When I right-clicked to open in TextEdit it opened in RTF format and showed as locked. I clicked the triangle and chose to unlock. It saved as html. Rather a pain but things behave well if I save from RTF in TextEdit to begin with.


You might want to try Bare Bones TextWrangler for text editing. It's an old reliable Mac standby that has a ton of customizable features.

Aug 26, 2011 8:43 AM in response to Peggy Lynn

I'd like to use TextEdit. But, for me, it is totally broken right now. I don't know if everyone is having the same problems, but this is what it is doing to me.


  • .TXT extension change - All plaintext document extensions are being changed to .txt on save (either explicit or autosave). I like to do my xml, html, etc. in TextEdit since it loads fast and used to be very reliable. This alone is bad enough, but coupled with the next problem, I have abandoned TextEdit as completely broken for my use case.
  • Unable to edit HTML - All HTML files are viewed as HTML in TextEdit now. Once a file has been ... I don't know... converted by TextEdit, I can no longer look at it in TextEdit as source. It only shows as HTML. This is very frustrating.


Hopefully, somebody is looking at this, because for me, TextEdit is completely broken in 10.7.1. I'm having to resort to using vi, as I stated earlier.

Aug 27, 2011 12:06 PM in response to Vic Riley

Known bug. If you want to report this issue to Apple's engineering, send a bug report or an enhancement request via its Bug Reporter system. To do this, register as an Apple Developer—it's free and available for all Mac users and gets you a look at some development software. Since you already have an Apple username/ID, use that. Once a member, go to Apple BugReporter and file your bug report or enhancement request. You'll get a response and a follow-up number; thus, starting a dialog with engineering. Numbers count, so join and file.

Sep 29, 2011 9:25 AM in response to Vic Riley

I'm having the same bug, and I'm using Lion.


Just forget textedit and use TextWrangler. It's free on the app store, it saves stuff at html (and keeps it that way when you save again), and it's simple.


I sincerely hope this helps someone because textedit was really frustrating me, even after I changed all the settings to what was supposed to work.

Feb 20, 2012 2:09 PM in response to Vic Riley

I'm having the same issues, even with the 10.7.3. I hope Apple can fix this. It's really aggrivating. I have just downloaded TextWrangler and so far it's been good.


If I change the settings in preferences I expect that everytime I open TextEdit, I will see proper code format and not have issues saving and viewing. It should stay that way until I decide to changeit back to text format. Yeesh!

TextEdit keeps saving .html file as .txt

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.