![]() |
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. 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: ![]() 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: ![]() 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: ![]() Looks good. Click on "OK", though, and now you get this: ![]() 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 Stumble Upon
Categorized:
Mac OS X Help
(Article 4097)
Tagged: Previous: Sarbanes-Oxley affects small businesses too? Next: How do I set my default email program on Mac OS X? View Mobile Version Subscribe!
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 PMThis 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 PMhi........ THANKS A LOT NOW I CAN SAVE IT !!!!!!!!!! Posted by: Shaun at February 17, 2008 9:24 AMhi 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 AMoh my god, thank you so much. i can finally turn in my homework. Posted by: b at June 13, 2008 7:33 AMWOW!! This is EXACTLY what i was looking for!! I'm actually very surprised i was able to find my solution online. (i thought i was a dolt because i didn't think it would be any different on a mac than on Windows.. and that i was doing something wrong) thanks SO much for posting this question and answer! Posted by: Lil at October 1, 2008 11:10 AMThank you so much! I have having this exact same problem. You have made me so very happy just now. :D Thanks! Posted by: MaeGal at January 10, 2009 5:18 PMTHANKS!!! Finally!!! Posted by: UUsfg at January 27, 2009 11:22 PMno, this still doesn't work. i've changed all the preferences and resaved and each time i reopen the file, it comes up as a page with no coding as though it were html instead of plain text. i use os X. Posted by: michael Hines at February 7, 2009 1:22 PMI can't get it to work either. I followed your directions above and saved as with .html extension. Looks OK in my browser (except for quotes and dashes come out as code - why is that?), but if I open the .html file in textedit to do some editing no code comes up. It look like the web page. Posted by: Anne at February 8, 2009 4:42 PMActually it doesn work after I changed my preferences. But how do I get apostrophes and quotes to display properly in HTML? Posted by: Anne at February 9, 2009 9:32 AMThank you - Thank you - Thank you!!! Posted by: Lauren at February 26, 2009 9:37 AMThank you. you solved my proble simple way Posted by: haleshk at March 2, 2009 2:18 AMThank you so much! I am a former windows user, and this issue was giving me a headache. Greatly appreciated! Posted by: Nathan at April 2, 2009 7:20 PMHi Dave, I downloaded a file which is not a pdf(my all time favorite). Only problem is I cannot save it to my HD. Thanks Posted by: Mee at April 4, 2009 2:01 AMhi. you know what. i am able to save it now and view it on my browser, but when i open up the file with textedit, all the codes are now gone....... what is up with that? Posted by: yu Chen at May 31, 2009 9:42 AMThank you so much thx a million !!! very helpful ! Posted by: desmond at September 9, 2009 9:00 PMThanks - you have just saved me so much money on Aspirin! Why do they do makes things so complicated? I appreciate your efforts. Posted by: John at September 17, 2009 5:31 AMDear Dave (if I may call you that), This is sound advice ... but I'm finding that my HTML shows up in the browser with a strange character -- Ê -- in place of many of the spaces (and not just in text content, but all over the HTML, which pretty much destroys the tags and formatting). ;-) I cut-and-pasted the text from TextEdit to MS Word, saved that as a text file (with .html extension), and the page rendered as intended. It appears that TextEdit is inserting these "spurious" characters into the text file in place of (some of the) spaces. Are you familiar with this? Thanks for all your help! (Using TextEdit 1.4 under Tiger 10.4.11) Should have included this above, but .... Might the character set in this tag have something to do with the matter? Darn it ... [left-angle-bracket] meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" / [right-angle-bracket] Posted by: Jerry Gloekler at February 24, 2010 1:53 PMYou nailed it, Jerry. Go to Preferences and look at the Open & Save tab. You'll see encoding preferences. I set mine to Unicode (UTF-8) and don't have that problem. I'll write a blog post about it soon. :-) Posted by: Dave Taylor at February 24, 2010 2:59 PMis there any way that i can save an html files with its value also.So that when i open that file again it comes in the same value that i had saved. Posted by: custom tailor at February 27, 2010 4:25 AMThanks, Dave. Actually, I _did_ have the "Encoding" preference set to UTF-8 ... but I noticed that I had the "Document Type" set to "HTML 4.0.1 Strict" when the pages I've been working on are of type "XHTML 1.0 Transitional". (So even though I don't see how THAT setting explains the issue, I changed it.) I was hoping to report that this fixed everything, but decided to test before posting. (Imagine that!) Unfortunately, something's still wrong. Somehow it seems the HTML text files get corrupted and get stored on the hosting site with these "Ê" characters (including "& Ecirc;" or hex 0xCB) and other trash (e.g."¬"/& not;/0xAC or "Â"/& Acirc;/0xC2), like this:
!DOCTYPEÊhtmlÊPUBLICÊ"-//W3C//DTDÊXHTMLÊ1.0ÊTransitional//EN"Ê"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> [right-angle-bracket]
Thanks again, and if I learn anything more, I'll post it. Posted by: Jerry at March 1, 2010 12:32 PMWhile you can make TextEdit work, it'd be better to use something like TextWrangler instead. TextEdit isn't primarily a plain text editor. Posted by: John Moreno at May 5, 2010 9:19 PMgreat! it worked Posted by: tama at June 20, 2010 9:41 AMI have something to say, now that you mention it, but ...
I do have a comment, now that you mention it!
|
Recommended
Recent Entries
Search
I Need Help!
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help |