Sunday, May 06, 2007

viewing and editing HTML source code in Mac TextEdit

Its been a loooong time since I've edited HTML on a Mac and I heard BBEdit is a great program. Unfortunately, it's $150, so I think I'll stick with TextEdit on the Mac. Using TextEdit though has an initial first hurdle to avoid. The idiotic default of TextEdit is to open up HTML files as rich text. Displayed as rich text, you can't see the HTML code in the file! Why would I want to display rich text by default in a text editor? The logic escapes me. Maybe Apple's developers will amend this in the next version of the software, as well as another pet peeve of mine I mention below.

First though, in order to get around the silly "rich text" default setting, when you open your HTML file, select File -> Open and be sure to select "Ignore rich text commands" as below:

You'll then see all the HTML in your file. Note: be sure to save your HTML from Safari as Format -> Page Source instead of Format -> Web Archive. Web Archive won't open properly in TextEdit.

To set this permanently in TextEdit, go to Preferences -> Open and Save -> select "Ignore rich commands in HTML files" as below:

While I'm ranting, another pet peeve of mine is Grab's inability to save to a browser-readable image format like JPEG or PNG. To capture images from a Mac for this blog, I'm forced to use Grab to save a screen capture of a window to a TIFF file and then open up Preview to convert the TIFF to PNG. This is stupid.

6/30/2007 Update: Ok. My apologies Apple Developers. I'm stupid. I did not see this feature in Preview:

Done ranting.


Seech said...

For a Mac[-only] editor, you might also want to check out TextMate. I was tempted to buy a Mac just so I could use that editor (only half-kidding ;)

Cacasodo said...

Thanks Seech,
I may try that. Also, I've been using Firebug recently. That program is great. Looking forward to posting a review of that soon.

By the way, the dog in your profile looks very familiar.

Cacasodo said...

And I was a die-hard PC guy until I got this new MacBook Pro. Simply put: it just works. Very few hassles with drivers or softwares that don't work. Highly recommended.

Feel free to drop me a line or ask me a question.