Documentation
Not logged in
ScriptHostZAAP is a ZAAP, a ZTreeWin Assistant Application Program, 
which provides a way to execute any Windows Active Script language 
(VBScript and JScript by default, ActivePerl, ActivePython if 
installed) in reaction to changes or commands in ZTreeWin.


Installation:
------------
* Extract the contents of the distribution zip to a directory anywhere 
  on your computer.
* Run the executable.  If you get errors, verify that you have the 
  dependencies listed below installed correctly.

Dependencies:
------------
This program requires the following components to be present (and registered) on the computer:
* Ian Binnie's ZBarCOM library, see the following pages:
	http://binnie.id.au/Downloads/ZbarCOM.zip
	http://www.ztwiki.com/tiki-index.php?page=u_ZbarCOM
* Microsoft's Windows Script Control
	http://www.microsoft.com/downloads/details.aspx?familyid=d7e31492-2595-49e6-8c02-1426fec693ac
	http://www.google.nl/search?q=download+MS-Script-Control

Usage:
-----
* Run ZTreeWin using the /ZB command-line switch;
* Run ScriptHostZAAP.exe (you can run it before or after ZTreeWin, 
  it'll connect to it whenever it sees it);
* You'll see the contents of the zbar.dat change as you navigate in 
  ZTreeWin.
* Within ZTreeWin, you can now evaluate script code in Assist mode:
  - either highlight a file (or directory), and press Y;
  - or tag one or more files, and press Ctrl-Y;
  - in the prompt, type 'seval <language> <code>', e.g.:
    seval jscript File.name.length > 10
	  will cause the file(s) with a filename longer than 10 to be 
	  tagged.
	seval vbscript File.DateLastModified > (Date() - 7)
	  will cause files, modified since seven days ago, to be tagged.
  
Writing scripts:
---------------
* Place your script files in the .\Scripts directory below the one 
  where the ScriptHostZAAP.exe resides.
* Each script file should have the appropriate extension for its 
  language; so .vbs for a VBScript file, or .js for a JScript file.
* If you've made changes to a script file, press [F5] to reload all 
  scripts.

* A script gets executed in three ways:
  - Any code that runs in the 'main' section (usually, outside of any 
    function) will be executed when the script is loaded.
  - If a function with the name 'onUpdate' is present, it will be run
	whenever ZTreeWin publishes a new pamphlet in zbar.dat (this will 
	usually be whenever the user navigates in ZTreeWin, or executes a 
	command)
  - If a function with the name 'onAssist' is present, it will be 
    called whenever the user runs an Assist command (Y or Ctrl-Y):
	- if the function returns true, then the file will be tagged;
	- if the function returns false, then the file will be untagged;
	- if the function returns null, then ZTreeWin will wait for another
	  script to respond.

  See also the sample script RegExp.js provided with this distribution.