
  <COL width=56>
  <COL width=200>
  
  <TR vAlign=top>
    <TD width="22%">
      <P><B>Part</B></P></TD>
    <TD width="78%">
      <P><B>Description</B></P></TD></TR>
  <TR vAlign=top>
    <TD width="22%">
      <P><I>FieldNameOrIndex</I></P></TD>
    <TD width="78%">String or Integer: Field Name or Index to identify field 
      to manipulate</TD></TR>
  <TR vAlign=top>
    <TD width="22%">
      <P><I>FormIndex</I></P></TD>
    <TD width="78%">Integer: only needed when there are multiple forms on a page 
      </TD></TR>      
  <TR vAlign=top>
    <TD width="22%">
      <P><I>ArrayIndex</I></P></TD>
    <TD width="78%">
      <P>Optional Integer, only needed when multiple fields have the same 
      name</P></TD></TR>
  <TR vAlign=top>
    <TD width="22%">
      <P><I>Value</I></P></TD>
    <TD width="78%">
      <P>Value for the field, usually string, but can be numeric, or for 
      checkboxes, boolean =True/False</P></TD></TR></TABLE></P>
<P>&nbsp;</P>
<P><STRONG><FONT face=Arial>Call OutputToFile(&nbsp;<EM>Data,  Destination 
</EM>)&nbsp;</STRONG><BR>
<FONT size=2>Write&nbsp;string data as a disk file.&nbsp;  Very useful for logging 
results of scripting when developing scripts.<BR></FONT></FONT>
<TABLE border=1 cellPadding=5 cellSpacing=3 frame=below rules=rows 
  width="100%"><COLGROUP>
  <COL width=56>
  <COL width=200>
  
  <TR vAlign=top>
    <TD width="22%">
      <P><B>Part</B></P></TD>
    <TD width="78%">
      <P><B>Description</B></P></TD></TR>
  <TR>
    <TD width="22%"><EM>Data</EM></TD>
    <TD width="78%">String to write to disk as data</TD></TR>
  <TR vAlign=top>
    <TD width="22%">
      <P><I></I><I>Destination</I></P></TD>
    <TD width="78%">
      <P>String: full path of new file including file 
name</P></TD></TR></TABLE></P>
<P></P>
<P><FONT face=Arial><STRONG></STRONG></FONT>&nbsp;</P>
<P><FONT face=Arial><STRONG>stringData = 
FileGetText(<EM>File_with_full_path_name</EM>)</STRONG></FONT><BR>Read contents 
of a file into stringData.&nbsp; Useful for reading the contents of an 
attachment to feed into other systems like databases.&nbsp; eg<BR><FONT 
face="Courier New" size=2><STRONG>stringData =               FileGetText(PathAttachIn &amp; 
AttachFile(Index))</STRONG></FONT></P>


<FONT face="Times New Roman">
<TABLE border=1 cellPadding=5 cellSpacing=3 frame=below rules=rows 
  width="100%"><COLGROUP>
  <COL width=56>
  <COL width=200>
  
  <TR vAlign=top>
    <TD width="22%">
      Part</TD>
    <TD width="78%">
      Description</TD></TR>
  <TR>
    <TD width="22%"><EM>MessageString</EM></TD>
    <TD width="78%">Message to log</TD></TR>
  <TR vAlign=top>
    <TD width="22%">
      <I>Destination</I></TD>
    <TD width="78%">
      String: full path of new file including file name       
      </TD></TR></TABLE>
<P><FONT face=Arial><STRONG><FONT 
size=3></FONT></STRONG>     
      </FONT>&nbsp;</P>
<P><FONT face=Arial><STRONG><FONT size=3>LoggedMessage<BR></FONT></STRONG><FONT size=2>String Property, returns the 
previous logmessage sent to the logfile and monitor.</FONT> </FONT></P>
<P><FONT face=Arial><BR><STRONG>Call 
LogMessage(<EM>Message</EM>)</STRONG><BR><FONT size=2>Displays string 
<EM>Message</EM> on the PixieRobot Monitor, as well as writing it to its 
logbook.</FONT></FONT></P></FONT>
<HR>
<P>         
          
   &nbsp;</P></STRONG>
</BODY>
</HTML><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="StarOffice/5.2 (Win32)">
	<META NAME="AUTHOR" CONTENT="John Calder">
	<META NAME="CREATED" CONTENT="20001114;21301369">
	<META NAME="CHANGEDBY" CONTENT="John Calder">
	<META NAME="CHANGED" CONTENT="20001114;22153470">
</HEAD>
<BODY>
<P><STRONG><FONT size=4>PixieRobot: Email Help</FONT></STRONG></P>
<P>
<hr></P>
<P><FONT size=4><STRONG>Multiple Recipients<BR></STRONG></FONT>
</P>
<P>Use semicolons to separate multiple recipients and enclose the plain address 
only in &lt; ...&gt;<BR>eg<BR>
<font face="courier new">
<b>  To:
 &lt;john@pixieware.com&gt;;&lt;dave@pixieware.com&gt;;&lt;lucy@thetotal.co.nz&gt;</font></B></P>
<p>PixieRobot tolerates a range of variations on the above, 
eg comma instead of semicolon.&nbsp;<BR>          
         PixieRobot will attempt&nbsp;to put in the
"&lt;" and "&gt;" if you leave them out.&nbsp;Upper/lower case&nbsp;is not significant.<BR>
BUT the above example is our strongly recommended ideal.</p>
<p>
PixieRobot will send to any address, or semi-colon-delimited addresses, 
which you place on the "Bcc:" line.<br>
BUT that line itself is then stripped out
from the message before sending so you can use it for mailing lists which you do
not want viewed or made use of by your recipients.
</p>
<P>
<HR>

<P></P>
<P><FONT size=4><STRONG>Multiple Attachments<BR></STRONG></FONT></P>
<P>Use semicolons to separate multiple attachments<BR>eg<BR><FONT 
face="courier new" size=2><B>X-Attachments: 
C:\temp\pixieproxy.exe;C:\temp\preview.zip;C:\temp\scriptlog.txt</B></FONT></P>
<P><FONT face="courier new" size=2><B><FONT face="courier new" 
size=2><B>X-Attachments: 
pixieproxy.exe;preview.zip;scriptlog.txt</B></FONT></B></FONT></P>
<P><FONT face="courier new"><B></FONT></B>PixieRobot looks for files without 
full path names in the "AttachOut" subfolder.<BR>The semi-colon as separator 
is strictly enforced.&nbsp; Unlike multiple recipients, you can not use commas 
as an alternative.<BR>Note (this bears repeating): files specified without path 
info,&nbsp;ie character "\" does not appear, as per the 2nd 
example above, are taken from the defined "attachout" folder and deleted on 
send.</P>
<HR>
<P><STRONG><FONT SIZE=4>    
Scripting<BR></FONT></STRONG>The challenge that led to this: customers 
wanting to carry out custom processing of incoming messages and attachments. eg 
distributing attachments to other folders according
to their extensions or who the sender was.&nbsp; It is
also possible  to use scripting to reconfigure the
PixieRobot setup in response to command messages you send.</P>
<P>Features and points of our implementation</P>
<UL>
  <LI>There is one standard script which is fired
	when  email arrives. Write it as a text file
	"onReceive.txt" and&nbsp;write your main&nbsp;routine as a subroutine called Sub Main<BR>eg<BR><FONT 
  face="Courier New" size=2><STRONG>Sub
	Main<BR>&nbsp; Call 
  AttachMoveAll("\\tserver\xrepos\kt\")<BR>End 
  Sub<BR><BR></STRONG>
  </FONT>eg - script to move&nbsp;attached files&nbsp;into various 
  subfolders depending on subject.<BR>
  This example also includes error checking.<BR>
  <FONT face="Courier New" size=2><STRONG>Sub Main<BR>&nbsp; s = 
  LCase(Header("Subject"))<BR>&nbsp; b = True <BR>  &nbsp; If Instr(s, "orders") 
  Then&nbsp;<BR>&nbsp;&nbsp;&nbsp; b =           AttachMoveAll("J:\AttachIn\Orders\") 
  </STRONG></FONT><FONT face="Courier New" size=2><BR><STRONG>  
  &nbsp; ElseIf Instr(s, "quotes") Then&nbsp;<BR>&nbsp;&nbsp;&nbsp; b = 
  AttachMoveAll("J:\AttachIn\Quotes\") <BR>  &nbsp; ElseIf Instr(s, 
  "picked") Then&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;b = 
  AttachMoveAll("J:\AttachIn\Picked\") <BR>&nbsp; End If <BR>&nbsp; If b = False 
  Then '-- do EMERGENCY STOP <BR>&nbsp;&nbsp;&nbsp; Call LogMessage("ERROR:&nbsp;in&nbsp;move 
  of attachment, subject = '" &amp; s _ 
  <BR>&nbsp;&nbsp;&nbsp; &amp; "' at " &amp; Now &amp; ".&nbsp; PixieRobot 
  EMERGENCY STOP.") <BR>&nbsp;&nbsp;&nbsp; Call Shutdown <BR>&nbsp; End 
  If<BR>End Sub<BR></STRONG><FONT face="Times New Roman" size=3></FONT></FONT>
  <LI><FONT face="Courier New" size=2><FONT face="Times New Roman" size=3>If you would like to 
  call the script something other than "onReceive.txt",<BR>eg "myScript.vbs", 
  then use the "ScriptOnReceive=" line in 
  "PixieRobot.ini"<BR>eg<BR></FONT><STRONG>ScriptOnReceive=myScript.vbs<BR></STRONG></FONT>
	<LI>
  <P style="MARGIN-BOTTOM: 0in">The PixieRobot methods and 
  properties are supplied as an implicit object, ie functions such as  <FONT 
  face="Courier New" size=2><STRONG>AttachMove</STRONG></FONT>   
	          
	&nbsp; become part of the VBSCRIPT language for this
	environment.  If you wish to write in object syntax, that implicit
	object is called "IM", so both of the following mean the
	same:<BR><FONT size=2><B><FONT FACE="Courier New, monospace">Call
	IM.AttachMoveAll("\\tserver\xrepos\kt\")<BR>Call
	AttachMoveAll("\\tserver\xrepos\kt\")<BR></FONT></B></P></FONT>
	<LI>
  <P style="MARGIN-BOTTOM: 0in">Some VARs may wish to 
  script using the System.FileSystemObject. An implicit one of these named FS is 
  already provided, and you can use all of its methods and properties 
  directly.&nbsp;eg<BR><FONT face="Courier New" size=2><STRONG>Set drv = 
  GetDrive(GetDriveName(drvPath))<BR></STRONG></FONT>      
	          
	        NOTE that you  still
	need to&nbsp;set and use sub-objects&nbsp;eg drv above<BR><BR></P>
	<P STYLE="MARGIN-BOTTOM: 0in"></P></LI></UL>
<P><STRONG><FONT SIZE=4>VBSCRIPT - notes </FONT></STRONG>
</P>
<UL>
	<LI><P STYLE="MARGIN-BOTTOM: 0in">The For ... Next loop requires
	that the closing keyword "Next" be on its own with no
	variable with it.&nbsp; That can be tricky to get used to,
	especially with the less than helpful error message it gives:&nbsp;
	<FONT SIZE=2><FONT FACE="Courier New"><STRONG>"1025, Expected
	end of statement"&nbsp; eg:<BR><B>'<BR></B></STRONG><B><FONT color=green>
	'distribute multiple attachments<BR></FONT>For i = 1 To AttachNumber <BR>&nbsp;
	Call AttachMove(i, sDestination(i))<BR>Next<BR><FONT color=green>'note this 
  must NOT be "Next i"</FONT>    
	  </B><BR></FONT></FONT><BR>
	</P>
	<LI><P>Method calls eg AttachCopyAll, as in all Visual Basic, have 2
	alternative syntaxes: Listing without parentheses, and CALL with
	parentheses.&nbsp; eg:<BR><BR><B><FONT FACE="Courier New, monospace" size=2 
 >AttachCopyAll
	"C:\Program Files\PixiePCL\Brother1\"</FONT></B><STRONG><FONT FACE="Courier New"><BR></FONT></STRONG>or<BR><STRONG><FONT FACE="Courier New" size=2>Call 
  AttachCopyAll ("C:\Program Files\PixiePCL\Brother1\")<BR></FONT></STRONG><BR><FONT SIZE=3><FONT FACE="Times New Roman">The first 
  "list" syntax seems to&nbsp;have been the "Microsoft Way" judging by their published 
  example code, but many of us who work with PICK are more comfortable with the         
  <STRONG><FONT FACE="Courier New"  
  size=2>Call(..)</FONT></STRONG>&nbsp; </FONT>syntax so&nbsp;we 
  use it in this documentation.<BR>ALSO, fashions are now changing at 
  Microsoft,&nbsp;eg the new dotNet BASICs will only support use of 
  parentheses<BR>so that gives a get-used-to-dotNet&nbsp;reason for 
  using<STRONG><FONT face="Courier New" size=2> Call(..)</FONT></STRONG><BR>
  <BR>
  Another syntax:<BR>
  <FONT face="Courier New" size=2><STRONG>b =   AttachCopyAll("C:\Program 
  Files\PixiePCL\Brother1\")</STRONG></FONT><BR>
  What is happening here is that<FONT face="Courier New" 
  size=2><STRONG> AttachCopyAll </STRONG></FONT>
         and some other<BR>
  related methods go further and double as&nbsp;<FONT 
  face="Courier New" size=2><STRONG> functions </STRONG></FONT>
         which can return<BR>
  results "True" or "False" to indicate success of operation.<BR>
  You use this to script error handling.<BR>eg<BR>
  <FONT face="Courier New" size=2><STRONG>
  b =
    AttachMoveAll("C:\Program Files\PixiePCL\Brother1\")<BR>If b = False Then Call 
  Shutdown</STRONG></FONT>      
  &nbsp;<BR></STRONG></FONT></P></LI>
</UL>
<P><FONT SIZE=4>      
     </FONT>&nbsp;<FONT SIZE=4 face=Arial><STRONG>IM 
(Internet Mail Object): details of&nbsp;the scripting properties and methods 
<BR></STRONG>   Grouped by purpose, all
keywords and file/path strings are case-insensitive.</FONT></P>
<P><STRONG><FONT face=Arial>Archive</FONT><BR></STRONG>Boolean&nbsp;property 
eg&nbsp;<BR><STRONG><FONT face="Courier New" size=2>Archive =       True&nbsp; 'files sent are saved 
in archive folders<BR>Archive = False '(default) all files sent are 
deleted</FONT></STRONG></P>
<P><FONT face=Arial><FONT 
face=Arial><BR><STRONG>AttachNumber<BR></STRONG></FONT><FONT size=2>How many attached files 
there are in the message just arrived.</FONT></FONT><FONT face=Arial><STRONG><FONT 
face=Arial><BR>AttachFile( Index )<BR></FONT></STRONG><FONT 
size=2>String 
property to get the name of each attached file by an index from 1 to 
AttachNumber<BR>            
    eg</FONT> <BR></FONT><STRONG><FONT face="Courier New" size=2><FONT color=green>'This script fragment 
moves attachments to folders