Writing IBots Results To A File


Script to save iBot results to a file
—————
var FSO = new ActiveXObject(“Scripting.FileSystemObject”);
var foldername = GetConfigurationValue(“Log Dir”, “iBots”) + “\\” + UserID
if (FSO.FolderExists(foldername))
{
var fileName = foldername + “\\” + JobID + “-” + InstanceID + “-” + Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
else
{
FSO.CreateFolder(foldername);
var fileName = foldername + “\\” + JobID + “-” + InstanceID + “-” + Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
—————-
Note in the above I have paramterized so all the content for different users will go to the folder with their name. If folder does not exist then it will create it first time.
To setup the iBot you need to do is change the Delivey content as Attachment
Then in the Script just pass in the File name.
It send the Results of the iBot to PDF or whichever download format you use.
Default is 250 lines, but you can extend that to whatever number you want. By Default if you choose csv file then it will be all the data, no limit.