
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!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
Mac OS X Help
(Article 4155)
Tagged: Previous: Search Engine Friendly, or Easy Navigation? Next: Dashboard Widgets + My Mac Desktop aren't enough! Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. 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 PMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
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 HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Facebook, 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
Recent Entries
Book Links
|