<script>on mouseUpfullhelpend mouseUpon mouseenterhelper "Click here for more help for HTML Grinder."end mouseenter</script>
</part>
<name></name>
<script>on processif there is no file (cd fld basefolder) thenbeepanswer "The file you have specified for the Index doesn't exist!"else pass processend processon enterkeyset the hilite of cd btn "build index" to truewait 5set the hilite of cd btn "build index" to falsesend mouseup to cd btn "build index"end enterkeyon doitput cd fld basefolder into thefileopen file thefileread from file thefile until eofclose file thefileend doiton converter thefile,thecontentsput cd fld basefolder into baserput relativepath(baser,thefile) into thePathnameput thecontents into cd fld indexHoldfind string "<Title>" in cd fld indexHoldif the result is not empty then exit converterput (word 4 of the foundchunk)+1 into starterfind string "</Title>" in cd fld indexHoldif the result is not empty then exit converterput (word 2 of the foundchunk)-1 into enderput char starter to ender of cd fld indexHold into theTitleif the hilite of cd btn "alphabetize" is true and word 1 of theTitle is "The" thendelete word 1 of theTitleput ", The" after theTitleend ifput theTitle &"ΓÇó"&ThePathName &return after cd fld IndexListend converteron alldoneset the itemdelimiter to "ΓÇó"if the hilite of cd btn "alphabetize" is truethen sort lines of cd fld indexlist by item 1 of eachput the selectedtext of cd btn "format" into theformatrepeat with x = 1 to the number of lines in cd fld indexlistset cursor to busyput line x of cd fld indexlist into thisOneput item 1 of thisone into theTitleput item 2 of thisone into thePathget buildLink(theTitle,ThePath,word 2 of theformat)put it into line x of cd fld indexlistend repeatset the itemdelimiter to ","if theformat is "Unordered List" thenput "<ul>"&return before cd fld indexlistput "</ul>" after cd fld indexListelse if theformat is "ordered List" thenput "<ol>"&return before cd fld indexlistput "</ol>" after cd fld indexListend ifattachindex cd fld indexlist,cd fld basefolderget "The index has been added to the specified file."send "alldone it" to homie()end alldonefunction buildLink theTitle,thePath,formatget"<a href=""e&thePath"e&">"&theTitle&"</a>"if format = listthen get "<li>"&itelse get it & "<p>"return itend buildLinkon attachindex theIndex,thefileopen file thefileread from file thefile until eofclose file thefileput it into thecontents--put "<!--Index-->"&return&theIndex&return&"<!--End of Index-->" into theIndex--get search(thecontents,"<!--Index-->",true)put item 1 of it into startlineget search(thecontents,"<!--End of Index-->",true)put item 1 of it into endlineif startline is empty or endline is emptythen put return&return& theindex after thecontentselse put theIndex into line startline to endline of thecontents--open file thefilewrite thecontents to file thefileclose file thefile--put empty into cd fld indexlistend attachindex</script>