|
Posted by dorayme on 12/07/05 02:49
> From: Chris Beall <Chris_Beall@prodigy.net>
> dorayme wrote:
>>> From: Chris Beall <Chris_Beall@prodigy.net>
>>> On Windows, I use Notepad to create HTML from scratch.
>>>
>>> Today my daughter asked me what to use on a Mac. Apparently she has
>>> tried several tools, but has not been able to get any to work. As I
>>> understand her problem, she can create text files, but they continue to
>>> be recognized as only text files, even if given an .html extension. I
>>> vaguely recall that Mac uses a 'signature' or something other than the
>>> file extension to define the type of a file, but...
>>>
>>> Can anyone identify a standard (part of an Apple iBook preload) editor
>>> that can be used to create HTML files? If there's a trick to doing so,
>>> please describe the details, as I have no system with which to experiment.
>>>
>>
>>
>> Source code /is/ just text. And it does not matter what you
>> append on a Mac name in regard to what program it will open in;
>> double clicking will open the file according to the creator and
>> file type (this is "under the bonnet" and you need to read up on
>> this stuff, if you really want to know more ask further... I
>> will say this here: you /could/ get one of the many facilities
>> for changing the type of the text file so that it then "becomes"
>> an IE file or a Mozilla or iCab or Safari or Opera or whatever.
>> Then it will open in the specified browser. But I would not
>> advise this. The point about the source text is that it is
>> independent of any particular browser. Leave it that way! It is
>> then easy to modify and available in the text editor program you
>> prefer to work in.
>>
>> In the meantime your daughter will do this: She will create a
>> text file (Simpletext or whatever will do) and append the .html
>> after it (this is for a different purpose to /merely/ opening
>> the file) and drag the file with the mouse over any open browser
>> window or any browser app icon. Or (more bothersome) open a
>> browser and use file/open and then find the text file concerned
>> and it will express itself as a website page in the browser.
>>
>> The best text edtor in my opinion for this sort of work is
>> BBEdit or its descendants from Barebones. But Simple Text or
>> whatever is the simple text editor on your daughter's Mac should
>> be ok.
>>
>> -- dorayme
>>
> dorayme,
>
> OK, I think I'm getting closer. Let me repeat what I think you said and
> see if I got it right.
>
> Let's take the simplest case possible: I want to create a new web page
> from scratch. ...
>
> I open Simpletext and create a New file. I type in my HTML. I Save the
> file, naming it xxx.html.
>
Yes.
> At this point, although I've NAMED the file xxx.html, it is still just
> TEXT to the Mac OS. Unlike Windows, which associates file extensions
> with an executable program, Mac has a separate function to do this.
> Simpletext itself does not contain the logic to do this, i.e. I can't
> say Save As HTML from within Simpletext.
>
Pretty well. The text file is a text file and it will open as
text in any text program according to the "under the bonnet"
Creator and File Type 4 digit names associated. with this file.
(Simpletext is "ttxt" for creator and "TEXT" for file type. If
you give it a browser creator and file type. If this is changed
to the BBEdit codes it will open in that text editor instead.
And, to home in on one of your main points of interest, if you
change it to "MSIE for creator and "TEXT" for type, then it will
open in IE as a website page (assuming the text is well formed
as HTML). The creator and file type tells the OS to open it in
IE. IE has built in intelligence to open it as a webpage (no
matter what the over file name is). Not Mozilla though! Mozilla
will open it as a text file - given the right creator and file
type codes - ok! You know, you see in the browser window the
actual text: <html> <head> blah blah.... But - and here is the
reason I said for your daughter to put .html on the end of the
name - Mozilla will open it as a webpage if it has .html
appended. This last is a peculiarity of the intelligence built
into some or all Mac Mozillas, it has little to do with Mac OS.
So, it is a good idea and does no harm to anything to append
..html to web text files.
There are further oddities and things to note. Where do I stop?
In IE one can call it anything, even an alias on the desktop
(shortcut) works, it will open it as a webpage. But not Mozilla!
Mozilla wants the extension.
> Instead, I can either:
> 1. Drag and drop the file on the application that I want to associate
> it with, in this case Safari.
> 2. Open the application I want to associate the file with, then, using
> that application, do a File, Open and select the target file.
>
> This will establish the association for THAT SPECIFIC FILE, but will NOT
> define an association for all files with the same file extension (unlike
> Windows).
>
> Once I've established this association, I can then just click on this
> file in the future and it will, by default, open in Safari.
>
Not really I am afraid. The creator codes and file types are
serious things in the Mac world. You can't simply change these
codes by using the files in some particular way.
I have described how to solidly change the program you want to
open any file with. You need for this a little app or a
facility. Typeshuffler is good, Norton's and other programs have
various facilities, ResEdit can do it. But read on...
I have recommended your daughter forget all this. Don't bother.
Leave text files as text files. Keep them in a folder along with
all the website associated folders like images for the site. You
would not normally want to change a file.jpg file to be an IE
file (though you can and it /will/ then open in IE). No, leave
..jpgs as they are and .html as they are (jpgs may be openeable
in QuickTime if that is what the creator code is set at) and
..html text files (openeable in Simpletext). If the jpgs and html
files (as links) are referenced in the text files, they will
work in the browser as you expect.
I know it is hard to grasp for Windows folk. If you do really
"associate" - by way of creator code and type "under the
bonnet" changes - text files with browsers apps, you then will
/lose/ the easy access to the text files! Where will they be
found? You can open the webpage and open the source in View
Source etc but then you need to be able to change the text and
there /may/ be ways of setting things to do this. But it is not
how I work or a lot of Mac people work. Don't worry about
associations so that "next time" it will open in a browser. It
is dead easy to drop the file.html over a browser icon or window
everytime you open your website. You don't have to do this more
than once per session. All the other html pages on the site will
be linked from within the browser and be found automatically,
just as they are when accessing text files on a server. My
websites on various servers look like this: index.html,
main.css, file.jpg, etc etc - (and logically ordered in folders
which are reflected in the paths written into the links in the
text files ) This is what is on my machine, and it is what is on
the server. All just text files and jpgs... plain and simple.
When accessing the website via a url (also, by the way, possible
off line to one's own files), the browser has the intelligence:
it looks for the file mentioned or else for something called
index.html and away you go...
--
dorayme
(I am not going to stop and fix typos... just excuse me)
> Thanks,
> Chris Beall
>
[Back to original message]
|