|
How do I use TextEdit with HTML files on Mac OS X?I wrote all of my web site's code using SimpleText in MacOS 9. Recently I made the step up to OS X and I've transferred all of my data from my old G-4 to the new system. When I open the html pages in TextEdit on OS X I am unable to go in and edit the code. Instead I get a screen that reads the the html and presents a page like one would see on the web. Is it possible to edit the html that was written in SimpleText and still keep it as a text file? There are a couple of ways you can address this problem. First off, in Mac OS X, files with ".html" filename suffixes are automatically associated with Safari, the Web browser, so if you double click on them, you don't get to an editor at all. To open a file in your editor, Control-Click on the file's icon. You'll see: ![]() You can see here that, oddly enough, I have three different versions of TextEdit on my own computer running Mac OS X Tiger 10.4.2. Weird! Anyway, that's the general technique you can use to open any file in Mac OS X with any of the set of applications that are known to handle that particular file type. To permanently change all ".html" files to open with TextEdit, instead of choosing "Open With..." you should choose "Get Info..." which reveals the following: ![]() Notice the "Open with" area in the Get Info window. As you can see, the default is to open this file -- and all files with this matching filename extension -- with Safari. You can change that by selecting another application from the pop-up menu, then clicking Change All.... Now, on to the specifics of your question. You ask why it is when you open up an HTML file that TextEdit shows you the formatted text rather than the actual HTML source. Great question! Here's what I see when I open a simple HTML file: ![]() Not good. To fix this we're going to have to change the Preferences, then quit and re-open the file. Fortunately, we'll only have to do this once on your Mac. Go to TextEdit --> Preferences... and choose "Open and Save". You'll see: ![]() The key is the first option under "When opening a file": you want to check Ignore rich text commands in HTML files. Check that option, then quit TextEdit. Now, open up the HTML file again, and here's what you'll see: ![]() Much, much better. It turns out you can also do this by manually selecting File --> Open..., choosing the file, and also selecting the option in the Open dialog window of "Ignore rich text commands", but since i'm always double-clicking on files or otherwise launching TextEdit, it's a much easier solution to simply fix the preferences and never worry about it again. Kind of a pain, but that's your solution path. Good luck with your editing!
Categorized:
Mac OS X Help
(Article 4155,
Written by Dave Taylor)
Tagged: Previous: Search Engine Friendly, or Easy Navigation? Next: Dashboard Widgets + My Mac Desktop aren't enough! Subscribe!
Dear Dave, i use a mac OSX(10.3) to do my site. Recently, i thought of purchasing a CGI script for my site but i have no idea, can a CGI script work with mac? I'm not a techie so need your help. Thanks mate! Posted by: Philip at October 1, 2007 7:31 PMDave, you're a sanity-saver. I was going spare trying to write website stuff on my newly acquired Mac. It's so much easier on Windows. Will buy you a chai soon (promise), when I've recovered from Mac-trauma. Posted by: gerrydunlop at January 29, 2008 8:20 AMThis is weird indeed. When I open an HTML file, TextEdit looses a couple of my CSS styles. So I decided to untick the box and to display all the HTML code. I don't know why this did not work for me, I tried everything with no success. IT Works!!!! NEXT STEP ... copy the ".html" text and paste into new TextEdit file and save over your old file in the same location! Thanks for the help. That solved my problem immediately. Why does Apple not make this the default ? Posted by: scott at June 14, 2008 3:39 PMPerfect! Thanks! Posted by: Julie at October 16, 2008 1:57 PMThank you! This has been a bigger and bigger thorn in my side as my family has slowly migrated more and more of our pcs to macs. I can work from home again! I agree with a previous commenter, why isn't plain text the default? If we want to see what it looks like in HTML, we can open a browser. Posted by: Lori at December 6, 2008 3:13 PMThanks, very big thanks Posted by: Magnus Janson at December 18, 2008 3:00 PMYAY! I was getting very frustrated with this problem, and your page was the first thing to come up in Google. It WORKED, and I am thrilled. THANK YOU! Posted by: Johanna at December 28, 2008 12:05 PMThank you very much..saved my day..!! Posted by: Alberto at January 26, 2009 11:48 AMDave, I accidentally trashed a memory stick containing vital data and text. The stick was written with SimpleText on Mac OS 9.2.2 I was unable to find any software to recover the files on 9.2.2 but I have recovered them with DataRescue on Mac OS 10.4.11 They only open with TextEdit as in the following examples ‚ Posted by: Ron Barnes at February 19, 2009 4:42 AMThis tip is a sanity saver! I'm used to using Notepad and was about to give up on TextEdit. I have one more problem when using TE for HTML. No images show up, even thought my path and spelling of the file name is correct. Neither a page background image or an inline image will show. Any ideas? Thanks Posted by: Diana at February 20, 2009 8:50 AMThank you so much, this was really helpful! Posted by: ShRobbo at April 5, 2009 1:16 PMThank you very much man. I was getting annoyed with the silly default interpretation of HTML files by TextEdit. Take it easy ;) Posted by: Charrals at May 8, 2009 6:36 PMthank you verymuch. this was a big help. Posted by: name1 at May 13, 2009 10:16 AMI'm just learning how to use a mac and this was SOOO helpful! THANK YOU! Posted by: Diane at May 22, 2009 2:43 PMThis really helped. My Dad is making small html documents for us, when he couldn't edit them again after closing them, he got upset. This explained everything! Posted by: Mac-User at June 24, 2009 1:59 PMLifesaver! TexEdit was really pissing me off!! I googled, I found this, and the problem was fixed! Broker Jones Posted by: Broker Jones at July 3, 2009 8:18 PMHi Dave, Thanks for that info I was having a real lot of trouble, you have saved my day! Yeah. Thanks Again It is so great to have people like you out there that will help beginners like us. You saved the day!! Thanks Posted by: Linda at July 22, 2009 4:27 PMI am writing an HTML document in text edit on my macbook pro and when I open up with my browser firefox (or safari) it is just displayed as the text not interpreted HTML Wow, thanks! This was so frustrating Dave - thanks for your step-by-step. I was getting increasingly frustrated and couldn't find what I was looking for until I came across your site. Thanks for making it easy :) Paul Posted by: Paul Norwine at August 21, 2009 12:04 PMHi, Please help as I don't want to go back to my pc to do it!!! Posted by: simon Phillips at October 2, 2009 3:31 PMHow i executing and running the PHP code in the mac o.s. Also i can't enable to execute the HTML code from above procedure. After that i used the the HTML file openwith in the Firefox browser then it worked. Posted by: Rajendra Bhole at October 12, 2009 7:07 AMI have the opposite problem. It only shows the HTML and not the formatted text when I open a new browser. I have checked and unchecked the Ignore rich text commands in HTML to see if there would be any difference. No change. Suggestions? Posted by: Ann Lew at October 19, 2009 9:49 AMTHANK YOU Help I have a similar but slightly different problem to what you describe above. When I click on a simple html file on my desktop, it opens in Safari, which is what I want it to do, but displays like a textedit file, showing the htiml code instead of displaying as a regular we page. Posted by: Mark Crawford at October 28, 2009 4:53 PMthank you A LOT!!! i was getting mad!!! very clear and simple explanation! now after this thanking i go to read ALL your posts! Posted by: mario isita at November 4, 2009 6:36 PMThanks, this helped a lot! P.S. To all of you unable to view pages you make in browsers, I suffered this problem for a while as well. I figured out that you have to do a couple things to the code itself: thank you!!!! Posted by: Michael Smith at December 19, 2009 1:48 PMExtremely Helpful. Thank you Posted by: Someone Learning Html at December 21, 2009 6:28 PMI'm learning to create a web page using TextEdit on a mac. Essentially I pasted:
and saved the file as HTML. The icon it opens in a browser (firefox or safari) just fine but all I get is the sam code back:
and not My big ole bad page Hello Joe!
Thank you!!!!!!!! Posted by: jenny at January 16, 2010 8:10 PMYou are my new demigod, as I learn to work with html, editing a site on my own computer for the first time instead of on the biz' setup. Thank you for your clear explanation! Posted by: Tina at February 1, 2010 11:16 PMThanks Dave, I'm just starting out and one goal is to change things in my website built by a friend a couple of years ago. Your article really helped! Best, SHOOOOT MAN. Thanks Dave! It was handy advice that worked - just when I needed it. Praveen Posted by: Praveen Puri at March 12, 2010 9:27 AMThanks Dave! I also just migrated from PC to Mac and use HTMl! You saved me! Posted by: Diana Kohne at April 14, 2010 9:48 PMYou have saved me so much time!! Posted by: steve at May 20, 2010 5:14 PMthat was perfect! tks a lot! Posted by: vferre at June 15, 2010 6:29 AMEditing html in Mac OS X 10.6 While I can edit with TextEdit, I find also available is Dashcode. I like the colored/formatted etxt. Are there any pros/cons to use of Dashcode simply for editing (not making projects or widgets etc)? Thanks in advance! Posted by: Zeke Zarnosky at June 23, 2010 11:15 AMZeke, I don't have much experience with Dashcode, but I can't imagine why it would be a problem! Posted by: Dave Taylor at June 24, 2010 7:54 AMThank you for explaining this to us. It will be a great help for many years to come. Posted by: Kevin Melanson at June 28, 2010 9:06 AMWow thanks! This is so helpful. :) Posted by: Siti at July 16, 2010 5:31 AMThis is such a basic thing, but it was messing me up along with all of these other folks. And driving me nuts. Now I understand that rich text must use html tags as well. I thought maybe text editor was acting like a brower! So confusing. Thanks very much for posting this!!!! Posted by: Dave at September 5, 2010 1:06 PMWOW. Thanks. Posted by: Johannes at September 7, 2010 12:14 PMThis doesn't fricking work. Mac OS is worthless for editing HTML. Posted by: meerkat at September 8, 2010 5:56 AMGREAT STEPS!! Worked for me! :) Posted by: SAY at September 22, 2010 5:43 AMThank You!!!! Posted by: adasd at October 4, 2010 9:58 AMthanks this really helped me out! Posted by: Steve at October 8, 2010 12:48 PMWOW!!! This article was very helpful. It was concise, clearly laid out, and addressed every last problem that one faces with using the mac text edit application. Thank you! Posted by: Anonymous at October 12, 2010 3:52 AMthis is really helpful thanks a lot Posted by: Asad at October 17, 2010 7:21 AMCHAMPION! Posted by: Rami Tawil at October 19, 2010 4:48 AMThanks, Dave. This is a big help. Posted by: Jonathan Rogers at October 22, 2010 9:52 AMORZ thanks a zillion Posted by: jane at November 2, 2010 10:38 AMhello.. THANK YOU sooooo much! Thank you very much! super duper tanx....solved ! im thrilled Posted by: aman at December 31, 2010 3:01 AMI have the same problem as the two posted questions below. I did not see an answer. Please help. I don't know why this is not working. I am writing an HTML document in text edit on my macbook pro and when I open up with my browser firefox (or safari) it is just displayed as the text not interpreted HTML Help I have a similar but slightly different problem to what you describe above. When I click on a simple html file on my desktop, it opens in Safari, which is what I want it to do, but displays like a textedit file, showing the htiml code instead of displaying as a regular we page. Posted by: Jayne at February 1, 2011 10:18 AMTHANK YOU!! I never would have figured this out without tearing chunks out of my hair. Posted by: J.C at February 6, 2011 7:07 PMI followed all your steps & still get the web page displaying but in TextEdit, not the code. What else can I do? Posted by: Enid Parry at February 8, 2011 8:59 AMWorked great. Danke! any suggestions? V/R Francis Posted by: francis at February 16, 2011 12:40 PMHi, i wanna design my website with html codes and im using text edit, but when i open the html file with safari or firefox just displays the same as text edit file, what can i do to make the browsers open my html as a web site??? Posted by: Marco at February 25, 2011 9:53 AMI am taking an html class, where we work on pc's using notepad. However, I work on a Mac at home. If I save my files in textedit as .htm will I be able to work with them on the pc in notepad when I go back to class? Thanks, great help here! Posted by: Kitty at March 17, 2011 11:23 AMThank you so much!! This post was a lifesaver. Posted by: Taylor at March 18, 2011 11:49 AMThanks so much!! Thank you so much!!!!! God bless Posted by: marie at April 3, 2011 7:46 PMDear Dave, Worked perfectly for me! thanks for the tip. Posted by: Emmanuel at April 15, 2011 8:25 AMAh, that was the trick I was hoping to find. Thou art thankt. Posted by: Gabor at May 4, 2011 1:05 PMthanks a lot, this helped out my whole class Posted by: austin at May 24, 2011 8:05 AMThanks! This enabled me to re-open my textedit html files and see my code. It was still showing as code in my browser, though, like some other still-confused people said here. I saw in TextEdit, Preferences, that under New Document, I needed to change to "plain text". That worked for new files from then on. For one I'd created already, I could now see all this rich text "html" in there that looked ok to me but it was only when I deleted all that stuff that that file opened correctly in the browser. Posted by: E.J. at May 27, 2011 10:13 AMDave, you're a legend! Your help was so clear and easy to understand. Thank you indeed sire. Posted by: Richard at June 20, 2011 11:31 PMThanks ... you just saved my sanity. Posted by: Matthew Guay at August 15, 2011 8:05 AMWorked for me. Great! Posted by: Hadi at August 17, 2011 10:51 AMu r a star! thanks for the wonderful step by step guide! Posted by: magz at August 19, 2011 10:02 PMTHANK YOU DAVE WORKS GREAT and I am personally astounded that Apple's default is to edit a html with Safari, which it cannot do! Appreciate your work! have the same prob as few others had it...when i open the html file in safari...entire code is displayed..i checked the suggested solution...declared the doc type and meta content as well in the html file code...however, it is still not opening in the web mode/formatted mode. Kindly help. Posted by: naveen at September 13, 2011 8:27 AMI am working with TextEdit in a MacBook Pro. OS 10.6.8. I change TextEdit default setting to Plain Text. I wrote the html and save it as .html but when I opened with Firefox or any browser the page opens in the browser window showing the exact html codes that I wrote. <html> <head>
</body> </html> I saved it as a .html. The default browser in my computer is set to work with Firefox, so I have now a document with the Firefox icon and the name I gave it. I double click this new document and Firefox browser opens but instead of showing the page with the Title, the body, etc. It shows the page identically as I wrote it. Do you think you could help me to solve the problem? I will appreciate any help. By the way, it works fine when I use a PC and write the same .html. Posted by: Gabo at September 20, 2011 7:43 PMGreat man ... tnx Posted by: Hans at October 1, 2011 9:50 AMClear, Concise and Exactly what was needed. Thank you. Posted by: Feidhlim Harty at October 5, 2011 1:10 AMThanks so much! This was a really big help!! Posted by: Stacey at October 6, 2011 1:26 AMThanks for the help! Posted by: Ian Robinson at October 20, 2011 10:27 PMThis was SOOOOO helpful!!!! It totally worked. :() Posted by: et at December 10, 2011 5:30 PMThank you! (why did i never look in preferences?) Posted by: max1zzz at December 19, 2011 11:57 AMThanks so much!! i thought i was going crazy trying to open my html... i'm new to mac, as you see ;) Posted by: arrikitukis at December 26, 2011 9:01 PMThank you so much! I can stop pulling my hair out now. :) Posted by: Eve at January 22, 2012 12:26 PMThanks this was very helpful -- just needed to click that option in the Text Edit prefs. Working just how i need it now - viewing complete HTML text without rich formatting. Posted by: Allie at January 22, 2012 1:15 PMI 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 CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help Google Plus Help HTML and CSS Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Mac OS X Help Pay Per Click (PPC) Advertising Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help WordPress Help |