<script>on mouseUpfullhelpend mouseUpon mouseenterhelper "Click here for more help for HTML Grinder."end mouseenter</script>
</part>
<name></name>
<script>on processglobal allfilesput cd fld tocpage into tocFileput length(cd fld delimiter) into delLongput the number of lines in allfiles into numfilesget windowscript("Grinding...")set thermometer_max of window "Grinding..." to numfilesrepeat with x = 1 to the number of lines in allfilesset the cursor to busyput line x of allfiles into thisFileput line x-1 of allfiles into prevfileput line x+1 of allfiles into nextfile----create the linksif prevfile is not empty and cd fld prevText is not empty thenput relativepath(thisfile,prevFile) into prevFileput "<a href=""e& prevFile "e&">"&cd fld prevtext&"</a>" into preverelse put empty into prever--if tocfile is not empty and cd fld returntext is not empty ¬and the hilite of cd btn "use table of contents page" is true thenput relativepath(thisfile,tocFile) into relTocFileput "<a href=""e&relTocFile"e&">"&cd fld returnText&"</a>" into toccerelse put empty into toccer--if nextfile is not empty and cd fld nextText is not empty thenput relativepath(thisfile,nextFile) into nextFileput "<a href=""e&nextfile"e&">"&cd fld nextText&"</a>" into nexterelse put empty into nexter----format the linksput "<!--Sequential Linkers-->"&return into addendumif prever is not emptythen put prever&cd fld delimiter after addendumif toccer is not emptythen put toccer&cd fld delimiter after addendumif nexter is not emptythen put nexter&cd fld delimiter after addendumrepeat dellong timesdelete last char of addendumend repeatput return&"<!--End of Sequential Linkers-->" after addendum----get the old fileif there is no file thisfile thenbeepnext repeatend ifopen file thisfileread from file thisFile until eofclose file thisfileput it into thecontents----create the new fileget search(thecontents,"<!--Sequential Linkers-->",true)put item 1 of it into startlineget search(thecontents,"<!--End of Sequential Linkers-->",true)put item 1 of it into endlineif startline is empty or endline is empty thenput word 2 of the selectedline of cd btn append into appendoif appendo is 1then put "0" into chartoucheelse if appendo is 2then put length(thecontents) into chartoucheelse if appendo is 3then put fulloffset(thecontents,cd fld texto,starter) into chartoucheelse if appendo is 4then put fulloffset(thecontents,cd fld texto,ender) into chartoucheif chartouche is not "error" thenif appendo is 1then put addendum &return&return after char chartouche of thecontentselse put return&return& addendum &return&return after char chartouche of thecontentselse put return& addendum after thecontentselse put addendum into line startline to endline of thecontentsreplacefile thisfile,thecontentsif iconnum =1then put 3 into iconnumelse put 1 into iconnumset thermometer_value of window "grinding..." to xset i3_name of window "grinding..." to "grinder"&iconnumend repeatclose window "grinding..."alldoneend processfunction fulloffset thecontents,thetext,whichwayput thecontents into cd fld holdingfind string thetext in cd fld holdingif the result is not empty then return "ERROR"else if whichway is starterthen return (word 2 of the foundchunk) -1else return (word 4 of the foundchunk)end fulloffseton enterkeyset the hilite of cd btn "link pages" to truewait 5set the hilite of cd btn "link pages" to falsesend mouseup to cd btn "link pages"end enterkeyon converter thefile,thecontentsput cd fld startTag into thestartput cd fld endTag into theEndget search(thecontents,thestart,true)if it is empty then exit converterput item 1 of it into startlineget search(thecontents,theEnd,true)if it is empty then exit converterput item 1 of it into endlineput thestart&return&cd fld thetext&return&theEnd into replacerput replacer into line startline to endline of thecontentsReplaceFile thefile,thecontentsend converterfunction lastchar thecontents,tagawareput thecontents into cd fld holdingif tagaware thenfind string "<!--footer-->" in cd fld holdingif the result is not empty thenfind string "</html>" in cd fld holdingif the result is not emptythen put length(cd fld holding) into chunkyelse put (word 2 of the foundchunk)-1 into chunkyelse put (word 2 of the foundchunk)-1 into chunkyelse put length(cd fld holding) into chunkyput empty into cd fld holdingreturn chunkyend lastcharfunction firstchar thecontents,tagawareput thecontents into cd fld holdingif tagaware thenfind string "<body>" in cd fld holdingif the result is not empty thenfind string "</head>" in cd fld holdingif the result is not empty thenfind string "</title>" in cd fld holdingif the result is not emptythen put "0" into chunkyelse put word 4 of the foundchunk into chunkyelse put word 4 of the foundchunk into chunkyelse put word 4 of the foundchunk into chunkyelse put "0" into chunkyput empty into cd fld holdingreturn chunkyend firstchar</script>