JScripts for HomeSite 4.0


Contributed by Enrique Bengoechea

HomeSite Toolbar for Htmlpp View


Htmlpp is a free HTML preprocessor which allows to industrialise your HTML writting and simplifies site building and maintenance. Because Htmlpp is a command-line tool, writting and debugging Htmlpp documents can be a slow task. HomeSite is one of the best text-based HTML editor running under Windows I have found, and provides a customizable rich environment for writting HTML files.

Here you can find several scripts for HomeSite 4.0 that help you use Htmlpp 4.2b from within HomeSite, so providing a comfortable graphic environment for running Htmlpp:

  1. The main script opens a dialog that allows you to select Htmlpp options for preprocessing current document. You can also choose to automatically edit or browse the intermediate working files and the final HTML files generated by Htmlpp. View a Screen Shot of the Dialog.
  2. Three scripts allow you to open the generated HTML files, browse the first generated HTML file, or open the intermediate working files from last run of Htmlpp, respectively.
  3. A script closes all open files related to the last run of Htmlpp.
  4. A script opens all .include'd files in current document.

Download and Installation


  • The scripts are written in JScript, and require to have installed the Microsoft Scripting Engines 3.01.
    Note: You should have them installed if you have Internet Explorer 5 or higher. Otherwise, you can freely download them from the above link.
  • You need to have installed and working Htmlpp 4.2b or superior. Previous versions are likely to work also, but 4.2b new options (-charset, -connect, -noconnect, and -expires) won't be recognized.


  • Download (25 Kbs.)
  • Unzip the file in a temporal directory.
  • In order to generate the graphic dialogs, the free ScriptX ActiveX control is required. It is provided with the scripts. If you haven't installed it previously, just run the supplied ScriptX.exe file.
  • From your HomeSite home directory, create the directory "scripts\htmlpp" and Copy the files *.js, *.html and *.bmp, to it.
  • Copy the file to the directory where Htmlpp is installed. You may need to customize the path to Htmlpp on it.
  • The scripts assume Htmlpp is installed on 'C:\htmlpp'. If it is not, modify the variable 'HtmlppPath' in each of the .js files.
  • From within HomeSite you can create a ToolBar and add buttons for each script, or run the htmlpp_installer.js script (e.g. by assigning it a button in a toolbar) which will create the toolbar with all the buttons.

Behavior of the Scripts

Whenever you run Htmlpp from within Homesite using the main script, it will store the names of the source file, the generated HTML files, the working files, and the errors file in file 'last_process.txt', which is stored in the same directory than the scripts. The generated HTML files are obtained by parsing Htmlpp run-time output.

Storing the info about last run is useful because all other scripts can use it by default to perform any operation, like 'Open intermediate working files'.

Some of the scripts will work only if the active document has extensions .htp or .def. You can modify the scripts to accept different extensions as Htmlpp documents.

htmlpp.js (Run Htmlpp)

The script starts by closing all open files related to previous Htmlpp processing (htmlpp.out, which contains the captured screen output, errors.lst, and working files html0001.wrk, html002.wrk...). This is useful so as not to confuse files from different Htmlpp runs. Then Htmlpp will be invoked with the selected options, and its output captured into file htmlpp.out. If some error arises, it will prompt to open the errors file errors.lst. Working files html001.wrk, html002.wrk, etc. will be open if you selected it. Also, if you selected to edit or browse the generated HTML files, the script will parse htmlpp.out and open all generated files it founds. Information about all files is stored in file last_process.txt in the scripts directory.

NOTE: The language option in the dialog just presets the standard variable LANG from the command line. If several languages are selected, the file will be processed once for each language presetting LANG accordingly each time. You can customize the script to adapt it to the languages you use.

htmlpp_opprocfiles.js (Open Generated HTML Files)

If there is only one open documente named htmlpp.out, invoking this script will parse it and open for editing all generated HTML files. Additionally, if there is selected text in that file, only that text will be parsed, what allows to selectively open files.

If there is no open htmlpp.out file, the script will search file last_process.txtand use the information from last run.

htmlpp_brfile.js (Browse First Generated HTML File)

This script behaves exactly as the previous one but opens only the first HTML file found in the internal browser (because only one document can be shown at a time).

htmlpp_opwrk.js (Open Working Files)

This script opens all intermediate working files (html0001.wrk, html0002.wrk, etc) from last run of Htmlpp, provided Htmlpp was executed in debug mode.

htmlpp_clall.js (Close All Last-Run Files)

This script closes all files generated by last run of Htmlpp.

htmlpp_opinclude.js (Open Included Files)

This script parses current Htmlpp document and opens all included files. If some text is selected when invoking the script, only that text is parsed, allowing for selectively open included files.

Scripts History

  • Version 0.2 released 13 March 1999.
    • Info about last Htmlpp run is stored, so that all scripts refer to that info by default.
    • The scripts now correctly handle relative paths of type './doc.htm'.
    • New scripts added: Browse first generated file, Open working files, Close all files related last run of Htmlpp, and Open included files.
    • Corrected bug: -set and -page options were not working.
  • Version 0.1 written 11 March 1999.
Index previous random next home home
HS WebRing links
The unofficial HomeSite WebRing made possible by the Webring.
Copyright © 1996-99 iMatix Corporation.
Hosted by Made with Htmlpp. Powered by Xitami.
Updated: October 20, 1999