Industry guru Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, Google AdSense, MySpace, Sony PSP, Apple iPod, Mp3 players, management, Linux, SEO, Mac OS X, Facebook, Twitter, LinkedIn and Microsoft Windows.

How do I save HTML files from TextEdit?

I am new to the Mac world and I have started with Tiger. When I use the textedit program to type HTML code and save it as an HTML document all I see is the code when I open the file in any of the browsers that I use. Unlike Notepad in Window, why can't I see the results of my code in a web page? I am completely lost and have combed the Internet. The simple Text Editor program in the older versions of the Mac OSs' seemed to work just like Notepad in Windows. Please let me know what I am doing wrong.


Dave's Answer:

Just as with NotePpad on the PC, there's a bit of a trick to getting TextEdit to save HTML files properly, and it's all to do with the filename extension.

Yes, we're now deep into the 21st Century, but computer operating systems still basically work like early DOS machines: If you have the wrong filename extension, either your OS itself won't understand it or your Web browser will be convinced that even though it looks like HTML inside it's really just plain text to show as-is.

Sheesh.

In TextEdit, you'll type in some HTML and have a window that looks like this:

TextEdit default view

This is not good because the program wants to work with Rich Text Format, not plain text (the ruler is the giveaway). To fix that, go to Format --> Make Plain Text and, voila! It'll look like this:

TextEdit plain text view

Much better!

Now, almost done (and you only have to go through this once: once the file is properly named, TextEdit will remember for future edit sessions). Choose File --> Save As... and type in a filename that includes a ".html" filename extension:

TextEdit save as html

Looks good. Click on "OK", though, and now you get this:

TextEdit use .html suffix

Click on "Use .html" and, finally, you're done!

Yes, it's a bit of a pain, but, as I said, you only have to do this once, when you first save the file, and from then on, it'll work transparently.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

A more permanent fix would be to enter TextEdit's Preferences. Inside the "Saving" area (near the bottom-right) there's an option that's checked by default, which you'd probably want to toggle:

• Append ''.txt'' extension to plain text files

Uncheck that, and you shouldn't have this problem anymore.

Posted by: Travis Seitler at August 2, 2005 3:00 PM

This method only works the first time you save the file. After that, it will be .html/.htm but when you reopen it TextEdit will kindly help you hide all your source code as rich text formatting and display only the outcome. To prevent this, open Preferences, go to the Open and Save tab, and check "Ignore rich text commands in HTML files". (This is on OS X Tiger)

Posted by: Michael Billips at February 19, 2007 2:50 PM

hi........
i mack 1html file.i know how to save that file.pls can u sead how to mack www.....com.theat file.

Posted by: niloy at April 27, 2007 3:18 AM

THANKS A LOT NOW I CAN SAVE IT !!!!!!!!!!

Posted by: Shaun at February 17, 2008 9:24 AM

hi thank you so much you helped me with making html with textedit ;) thanks a lot

Posted by: josh casbolt at June 4, 2008 10:11 AM

oh my god, thank you so much. i can finally turn in my homework.

Posted by: b at June 13, 2008 7:33 AM

I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Uniblue: Free Virus Scan

Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]