Saturday, November 6, 2010

Opening HTML files in Mac OS X TextEdit

Q. I can open a webpage in Notepad to make a trivial HTML changes on my Windows PC. When I try to do the same with TextEdit on Mac OS X, it opens . . . but I cannot see the "raw" HTML. What gives?

A. Although Notepad is a plain text editor, TextEdit supports Rich Text Format (RTF) and a few other file formats, which makes it more similar to WordPad than Notepad.  When you open HTML files in TextEdit, it tries to interpret Rich Text commands and display the page "visually" rather than the "raw" HTML text.

There is a way to tell TextEdit to open HTML files as plain text documents, however.

In TextEdit's Preferences dialog box, click on the "Open and Save" tab near the top,  remove the checkmark beside "Ignore rich text commands in HTML files" and close the dialog box. From now on whenever you open a webpage with TextEdit, you'll see the "raw" HTML code.