Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Text Edit - Converting all files to HTML at once?

Text Edit - Converting all files to HTML at once?
Thread Tools
meagain
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 02:12 AM
 
I have about 150 text documents in 'documents' in the finder which are html. I want to be able to open them in a 'preview the html' type mode. I understand that in order to do this, I have to open them and "save as" with ".html" extension. Then I can open them as they would appear, then still have access to the html code by 'view source'. Like I can automatically do without jumpting through such hoops in MS Word.

Would anyone know of any way I can gang-label these so I don't have to go through this process for each and every individual file? To add the html extension at the end?
Fingers crossed. Thanks!
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Nov 13, 2006, 10:30 AM
 
They don't necessarily have to have a .html suffix to be read by whatever app you want. Why not just open the files in that app?

If you want to batch-change the default app they open with, select them all, get info, then change the selection under Open with...
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 13, 2006, 11:16 AM
 
With regard to batch-renaming files, create a Finder plug-in for it with instructions from here:

Automator - Examples

With regard to previewing HTM files, why not simply drag them onto the Safari icon in the Dock?
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 11:34 AM
 
Wataru - I just switched to Mac from PC and didn't buy extra programs. I'm used to Word (or notepad?) where I can toggle between seeing my html code and a preview (pretty) version of the results of that code. On my new Mac, I only see "TextEdit" for word processing. I transferred my HTML text files and can't seem to find a way to see them without copying the html file and dumping it into a free online "html tester" page.

So I looked in TextEdit's help menu and it says to do this, I must open the file - save as - then type dot html on the end of each filename - save. Then when I open it, I get the preview/pretty view and can right click - view source on each to see & work on the html.
So unless there's another cool app in the system that I'm missing, TextEdit IS the app I need.

Tetenal - Dragging the file into Safari just gives me another view of my html file. Same thing. I don't see anything in Safari's menu to tweak. I'll try your link.
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 13, 2006, 12:01 PM
 
Originally Posted by meagain View Post
Tetenal - Dragging the file into Safari just gives me another view of my html file.
And what do you expect TextEdit to give you? You will just see your page as parsed HTML too, only worse since TextEdit's HTML display capabilities are not as advanced as Safari's.

Though you can edit a web page with text edit (enable "ignore richt text commands" in the TextEdit preferences or the open dialog) it is not intended as an HTML editor. For web page creation you are supposed to use iWeb (came with your Mac) or something like DreamWeaver if you do it professionally. I think closest to what you want might be PageSpinner.
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 12:27 PM
 
OK - Bad idea. I can't edit it now. At least I learned how to use Automator and can change it back to .txt.

My html files are already created. All I want to do is be able to tweak them a tiny bit here & there.
In Word and/or Notepad, I was able to tweak the html code, then hit a button to view what I just did. Very simple stuff. It seems Macs don't come with this ability and unless I purchase some package - have to copy my html code and dump it into some type of online html viewer page.

Would that be correct?
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 13, 2006, 12:47 PM
 
You can open the file in Safari and TextEdit at the same time. Tweak it in TextEdit, save it, then press the Reload button in Safari to view your changes.
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 01:16 PM
 
That sounds nice. I'm going to spend some time to figure out how to get it to show up in something other than html code. It will only open files with a .html extension.
Are you suggesting creating 2 separate folders and duplicating each file? One in .txt and one in .html? No, I don't think you are. LOL I've been thru the help menus and can't find how to do your trick.
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 13, 2006, 01:22 PM
 
No, I did not suggest you duplicate each file. You are editing HTML documents, so their extension should be .html. I already told you how to open HTML in TextEdit in the "text"mode without it rendering it: Go into TextEdit->Preferences->Open and Save and enable "Ignore rich text formats in HTML files". You then open the HTML as text in TextEdit and at the same file at same time in Safari. Once you make changes in TextEdit you save it (press ⌘S) and click the reload button in Safari to see the changes.

That's the free version of doing it. If you do this a lot you might want to have a look at PageSpinner or similar tools.
( Last edited by TETENAL; Nov 13, 2006 at 01:28 PM. )
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 01:40 PM
 
My TextEdit died. Has a blank textedit page that I've not been able to get rid of no red button and the rest are dead, can't quit the program from the dock, have no menu items for preferences, etc. in the upper right menu bar. I'm going to restart the computer to see if it fixes it.
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 02:19 PM
 
I just learned about "force quit"

OK - I'll reconvert all the files to have an HTML extension again with the automator. I tested one and it worked. A bit clumsy, compared to a pc, but..... Thanks
     
Mastrap
Addicted to MacNN
Join Date: Sep 2001
Location: Toronto
Status: Offline
Reply With Quote
Nov 13, 2006, 03:11 PM
 
Just get yourself a copy of Tag or any other application that's actually designed for html editing and previewing.

Using Word for html is an... interesting solution.
     
lookmark
Mac Elite
Join Date: May 2001
Location: NYC
Status: Offline
Reply With Quote
Nov 13, 2006, 03:16 PM
 
TextEdit isn't ideal for coding, really, esp HTML (though doable, if you set the pref to ignore rich text).

For text editors, check out Bare Bones' TextWrangler (free) or TextMate ($50).

edit: mmm! Tag looks nice too.
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 13, 2006, 07:37 PM
 
Thanks guys. I got my project done and familiarized myself with the system at the same time.
Awesome! I'll likely buy a web design software in the future, but I'm up and running.
     
Tuoder
Mac Elite
Join Date: Mar 2006
Location: Here
Status: Offline
Reply With Quote
Nov 17, 2006, 10:53 AM
 
Originally Posted by meagain View Post
Thanks guys. I got my project done and familiarized myself with the system at the same time.
Awesome! I'll likely buy a web design software in the future, but I'm up and running.
It doesn't sound like you have actually heeded their suggestion. I will show you.



     
JKT
Professional Poster
Join Date: Jan 2002
Location: London, UK
Status: Offline
Reply With Quote
Nov 17, 2006, 11:35 AM
 
There are two freeware apps that you can try which will improve your life no-end as they will colour code the html syntax for you:

Smultron by Peter Borg

or

Bare Bones Software : PRODUCTS : TEXTWRANGLER

Under the Tools menu in Smultron is a Preview option which will show you the html rendered using WebKit:



Textwrangler doesn't have this but has more powerful text editing features.
( Last edited by JKT; Nov 17, 2006 at 11:42 AM. )
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 17, 2006, 02:54 PM
 
OMG - Perfect!!!!!!!!!!!! Thank you!
     
meagain  (op)
Junior Member
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 17, 2006, 03:03 PM
 
I have no idea why things don't work for me as they do others. I dumped my html in there then did 'preview' but it's a blank page. Will play around more.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:53 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,