0% found this document useful (0 votes)
38 views

Note. Before You Can Create Your Own HTML Help File, You Must Download and Install A

The document provides instructions for creating a customized HTML Help file (.chm) to package and share scripts. It describes preliminary steps like ensuring required files are in the same folder. It explains how to create a customized help file with only a subset of scripts from the database by modifying queries in the .vbs files. It also discusses optionally customizing the look of HTML pages by modifying the HTMLPageMaker.vbs script.

Uploaded by

SunilLanka
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Note. Before You Can Create Your Own HTML Help File, You Must Download and Install A

The document provides instructions for creating a customized HTML Help file (.chm) to package and share scripts. It describes preliminary steps like ensuring required files are in the same folder. It explains how to create a customized help file with only a subset of scripts from the database by modifying queries in the .vbs files. It also discusses optionally customizing the look of HTML pages by modifying the HTMLPageMaker.vbs script.

Uploaded by

SunilLanka
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

Creating Your Own HTML Help File

The HTML Help format (files with a .chm file extension) is a hand wa to pac!age up and share
scripts. Of course" the #cripting $us ha%e alread done this for ou" ha%en&t we' (idn&t we
create a .chm file that includes all the )*#cript scripts found in the #cript Center'
Yes" we did. +nd if that .chm file suits our needs" then there&s no reason for ou to create and
compile our own help file. On the other hand" ma,e the .chm file that we made a%aila,le has a
,unch of scripts ou don&t reall care a,out- after all" if ou aren&t running ..# /.0 then ou might
not want a couple hundred ..# /.0 scripts in our help file. Li!ewise" ma,e the .chm file we made
a%aila,le is missing some scripts that ou would find useful- for example" it&s more than li!el
none of the scripts ou or others in our organi1ation wrote are going to ,e found there. 2ouldn&t
it ,e nice to ha%e a help file that featured not onl the #cript Center scripts" ,ut the scripts that
ou write (and use) as well' Of course it would ,e. *ut those la1" good3for3nothing #cripting
$us aren&t going to create a custom help file for ou- the ,est ou&ll get out of us are some
instructions and scripts that will help ou create such a file ourself. +nd that&s exactl what this
document will do4 it will tell ou how ou can create a customi1ed .chm file all our own.
Note. *efore ou can create our own HTML Help file" ou must download and install a
cop of the HTML 2or!shop. You can o,tain the latest %ersion of the HTML 2or!shop 5
and its accompaning documentation 5 from the Microsoft Downloads Center.
6reliminar #teps
(o the following before ou tr to create and compile our own help file. (He" trust us- we
wouldn&t tell ou to do these things if the weren&t necessar7)
8. Ma!e sure the following files are all located in the same folder somewhere on our hard
dis! (it doesn&t matter which folder" 9ust as long as the&re all in the same spot)4
HTML:Folder:Ma!er.%,s
HTML:6age:Ma!er.%,s
HTML:File:List:HH6:Ma!er.%,s
HTML:Ta,le:of:Contents:Ma!er.%,s
#cript:Center:;.md,
O!" we knew ou were going to as! that. #ome of ou might want to store the +ccess
data,ase (#cript:Center:;.md,) in a different folder- for example" ou might want to
ha%e the scripts stored locall on our hard dri%e" ,ut ha%e the data,ase stored in a
shared folder where other people can access it. Can ou do that' #ure. Howe%er" ou&ll
ha%e to edit each of the .%,s files and loo! for this code4
objConnection.Open _
"Provider= Microsoft.Jet.OLEDB.4.0; " _
"D!t! "o#rce=script_center_$.%db"
You&ll need to replace script:center:;.md, with the appropriate path. <ote that if our
path includes spaces" this can get a ,it tric!. Here&s an eas to get around that pro,lem4
strP!t& = "C'(P#b)ic(*d%inistr!tive "cripts(script_center_$.%db"
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
"D!t! "o#rce=" strP!t&
;. Create a folder named C:\HTML- this is the default folder used , the (o3.t3Yourself =it
scripts when creating an HTML Help file. <ote that ou don&t have to use this folder- ou
can store our files in an folder ou want to. Howe%er" the path C4>HTML has ,een hard3
coded into the four scripts used to create an HTML Help file. .f ou want to use a folder
other than C4>HTML" open each of these four files" find the path C:\HTML" and change it
to the appropriate folder path4
HTML:Folder:Ma!er.%,s
HTML:6age:Ma!er.%,s
HTML:File:List:HH6:Ma!er.%,s
HTML:Ta,le:of:Contents:Ma!er.%,s
?. Cop the files Default.htm and Icon.jpg. These are the default files used to create the
home page for the 6orta,le #cript @epositor. .n case ou&re wondering" the page itself
loo!s li!e this4
<ow" ou might %er well ,e saing" A2ait a second" . don&t want to use your home page-
. want to use m own home page.B He" ta!e it eas4 that&s perfectl fine with us. .n that
case" the easiest wa to do this is to create our own home page" name it default.htm"
and then cop that and an accompaning files (such as graphics) to C4>HTML. +nd if
ou really want to do this ourself" and don&t want to name our file default.htm" well"
e%en that&s O=. Cust open these two scripts" search for default.htm" and then replace
default.htm with the name of our file4
HTML:File:List:HH6:Ma!er.%,s
HTML:Ta,le:of:Contents:Ma!er.%,s
*ut" reall" it would ,e a lot easier 9ust to name our file default.htm. +nd if anone as!s"
we promise to tell them that no" Microsoft didn&t force ou to use that file name" ou
chose it on our own.
D. .f ou want to create an HTML Help file that includes all the scripts found in the data,ase"
then ou&re read to ,egin. Howe%er" what if ou want to create a customi1ed HTML Help
file" one that includes onl a su,set of the scripts found in the data,ase' 2ell" in that
case" ou ha%e at least two options.
First" ou can simpl remo%e the scripts that ou don&t want- as a result" the data,ase will
include only the scripts that ou want to show up in the help file. This isn&t the most high3
tech and sophisticated approach in the world" ,ut it&s definitel fast" and it will definitel
wor!. To do this" ma!e a cop of #cript:Center:;.md," and sa%e that cop somewhere
safe. (That wa" ou&ll alwas ha%e a %ersion of the data,ase that contains all the scripts.)
Open #cript:Center:;.md, in Microsoft +ccess" open the #cripts ta,le" and then delete
the scripts ou don&t want. (Or" if ou&re comforta,le wor!ing with +ccess" write a Euer
that will delete the scripts ou don&t want.) Fpon finishing" ou&ll ha%e a data,ase
containing onl a su,set of scripts" and ou can run the .%,s files against that data,ase
without ha%ing to change the .%,s files in an wa.
<ow" the preceding approach will wor! 9ust fine- on top of that" it&s ,oth Euic! and eas.
Howe%er" it&s not %er flash- if ou&re tring to impress someone" the old3fashioned
method of deleting records from a data,ase won&t suffice. Therefore" a second wa to
create a custom help file is to modif the Eueries that extract records from the data,ase.
To do this" ou&ll need to open each of the .%,s files and loo! for #GL Eueries similar to
this4
obj+ecord"et.Open ""ELEC, - .+OM "cripts /0E+E "criptL!n1#!1e =
23B"cript2 O+DE+ B4 P!t&"5 objConnection5 !dOpen"t!tic5
!dLoc6Opti%istic
2hat ou will need to do is modif the 2HH@H clause to specif which files should ,e
created and added to the help file. For example" suppose ou wanted to create a help file
consisting onl of 6erl scripts. .n that case" the actual #GL Euer would loo! li!e this4
""ELEC, - .+OM "cripts /0E+E "criptL!n1#!1e = 2Per)2 O+DE+ B4
P!t&"
2hat if ou wanted onl )*#cript scripts that wor! on 2indows <T D.0' .n that case"
our Euer would loo! li!e this4
""ELEC, - .+OM "cripts /0E+E "criptL!n1#!1e = 23B"cript2 *7D /in7,
= 24es2 O+DE+ B4 P!t&"
How a,out a .chm file consisting onl of ..# /.0 scripts4
""ELEC, - .+OM "cripts /0E+E "criptL!n1#!1e = 23B"cript2 *7D
C!te1or8$ = 299" :.02 O+DE+ B4 P!t&"
You get the idea. Ta!e a loo! at ,oth the data,ase and the (ata,ase (escription
document" and ha%e at it. @emem,er4 ou&ll need to modif each of the .%,s files to
ensure that e%erthing wor!s correctl.
I. #tep I is optional" ,ut we !now it will come up4 what if ou don&t li!e the loo! of the HTML
pages' * default" this is what the HTML pages loo! li!e when ou generate them using
HTML:6age:Ma!er.%,s4
#ure" we thin! the&re a wor! of sheer ,eaut" ,ut there&s no accounting for taste" right' .f
ou want our pages to ha%e a different loo! and feel" ou&ll need to modif the script
HTML:6age:Ma!er.%,s. This is not necessaril hard to do" ,ut it can ,e a ,it tric!- on
top of that" ou&ll need to !now not onl a little something a,out )*#cript" ,ut also a little
something a,out HTML. Howe%er" it&s not impossi,le.
For example" suppose ou want to change the ,ac!ground color from white to a light
,lue. That&s a fairl eas one- 9ust open HTML:6age:Ma!er.%,s and loo! for this line of
code4
7e;.i)e./riteLine "<bod8="
+s ou can pro,a,l tell" this line of code writes a simple ,od tag to the HTML file- in
other words4
<bod8=
To ha%e a light ,lue ,ac!ground" ou need this ,od tag instead4
<bod8 b1co)or=">*0C?D:"=
ConseEuentl" ou&ll need to change the code Newile.!riteLine "#$od%&" so that it
writes this new ,od tag. This ought to do the tric!4
7e;.i)e./riteLine "<bod8=" c&r@A4B ">*0C?D:" c&r@A4B "="
Yes" it loo!s weird" ,ut that&s ,ecause we ha%e to em,ed dou,le Euotes in the string
(that&s what chr(?D) does). 2e&re not saing it&s the most fun ou&ll e%er ha%e" ,ut it can
,e done.
Or perhaps ou&d li!e to stic! our corporate logo on the top of each page. Here&s the
HTML code for that (assuming our corporate logo is named icon.9pg)4
<i%1 border="0" src="icon.jp1" ;idt&="C?D" &ei1&t="$CC"=<p=
To get the script to write this HTML code" ou&ll need to do something similar to this4
7e;.i)e./riteLine "<i%1 border=" c&r@A4B "0" c&r@A4B
"src=" c&r@A4B "icon.jp1" c&r@A4B " ;idt&=" c&r@A4B
"C?D" c&r@A4B " &ei1&t=" c&r@A4B "$CC" c&r@A4B "=<p="
+gain" the !e is to use chr(?D) to insert dou,le Euotes an place the&re needed. Or" 9ust
cop the a,o%e" paste it in" and change the parameter %alues as needed.
Note. +ren&t there other was to insert dou,le Euotes ,esides chr(?D)' +s a
matter of fact" there are. *ut this is the approach we use> throughout our scripts"
so that&s the wa we recommend ou do it. *ut it doesn&t reall matter as long as
ou somehow get those dou,le Euote mar!s em,edded.
+ somewhat easier thing to do is remo%e the disclaimer at the ,ottom of each scripts
(now that these are your scripts" ou&re on our own what ou do with them). To do that"
9ust open HTML:6age:Ma!er.%,s and remo%e all the lines used to write the disclaimer.
.n the end" ou&ll ha%e something that loo!s li!e this4
2ell" O=4 hopefull ours will loo! a little ,etter. *ut at least ou can change the pages if
ou so desire.
Tip. .f ou want to create a reall fanc page" ou might consider designing the
page in an HTML editor (li!e Front6age) and then coping the HTML code out of
there. #a ou get HTML code similar to this4
<p st8)e="%!r1inE)eft' 0.?in; %!r1inEri1&t' 0.?in; %!r1inE
top' 0in; %!r1inEbotto%' 0pt"=
6aste that code directl into our script" and then modif it to loo! li!e this4
<p st8)e="%!r1inE)eft' 0.?in; %!r1inEri1&t' 0.?in; %!r1inE
top' 0in; %!r1inEbotto%' 0pt"=
+ll we&re doing is slapping Newile.!riteLine " onto the ,eginning and " onto
the end. Thus4
NewFile.WriteLine "<p st8)e="%!r1inE)eft' 0.?in; %!r1inE
ri1&t' 0.?in; %!r1inEtop' 0in; %!r1inEbotto%' 0pt"="
2e then use chr(?D) to insert dou,le Euote mar!s as needed" and we end up
with this4
NewFile.WriteLine "<p st8)e=" & chr(34) & "%!r1inE)eft'
0.?in; %!r1inEri1&t' 0.?in; %!r1inEtop' 0in; %!r1inEbotto%'
0pt" & chr(34) & "="
$ood point4 or ou could 9ust lea%e the pages as3is.
/. You might also want to change ,oth the text that appears in the title ,ar of our finished
.chm file (, default" that&s The 'orta$le (cript Center) as well as the file name of the
.chm file (, default" script)center.chm). .f ou&re not real !een on either of those
options" then edit these two lines in HTML:File:List:HH6:Ma!er.%,s4
obj.i)e./riteLine "Co%pi)ed fi)e=script_center.c&%"
obj.i)e./riteLine ",it)e=,&e Port!b)e "cript Center"
Oh" and open up HTML:Ta,le:of:Contents:Ma!er.%,s and search for this line of code4
obj.i)e./riteLine " <p!r!% n!%e=" c&r@A4B "7!%e"
c&r@A4B " v!)#e=" c&r@A4B ",&e Port!b)e "cript Center"
c&r@A4B "="
2hen ou find it" change The 'orta$le (cript Center to whate%er ou li!e ,etter.
Creating and Compiling the +ctual HTML Help File
+s soon as ou ha%e all the preliminaries out of the wa" creating and compiling a help file is
remar!a,l Euic! and remar!a,l eas (the whole thing will ta!e onl a few minutes). #tart ,
carring out these steps4
8. @un the script HTML)olderMa*er.+$s to create the folders where the HTML pages will
,e stored.
;. @un the script HTML)'age)Ma*er.+$s to create the actual HTML pages.
?. @un the script HTML)ile)List)HH')Ma*er.+$s to create the configuration file for the
HTML Help pro9ect.
D. @un the script HTML)Ta$le)of)Contents)Ma*er.+$s to create the Ta,le of Contents for
the help file.
2hen these four steps are done" ou&ll ha%e all the pieces ou need to create an HTML Help file-
all that&s left to do is compile the actual .chm file. .f ou want" ou can do this right from the
command line using the file hhc.exe (most li!el ou&ll find that file in C4>6rogram Files>HTML
Help 2or!shop). Cust tpe hhc.e,e followed , the path to the .hhp configuration file. +ssuming
ou ha%en&t changed an of the default %alues" ou&d tpe this4
hhc.e,e c:\html\script)center.hhp
Most li!el ou&ll see a flurr of warnings regarding empt HTML tags- don&t worr a,out those.
2hen the compile is done" ou&ll ha%e a new file (, default" named script:center.chm) read to
use.
+nd" es" ou could also open the .hhp file in HTML Help 2or!shop" and compile the .chm file
from there- ou could also use HTML Help 2or!shop to modif the pro9ect further. *ut ou&re on
our own for that.
#o does this actuall wor!' You ,et it does- here&s a sample .chm file we created (following our
own instructions) that has a different default page and contains onl scripts that run on 2indows
<T D.0 (notice that the Ta,le of Contents doesn&t include categories li!e )irtual #er%er)4
. !now" it&s hard to ,elie%e- e%en we didn&t expect something li!e this to wor!. *ut it does.

You might also like