VBS

Let’s say you would like to create a template which allows you to browse to the folder you want to store the document in, from your MFP or PC Client.

You would create three scripts first:

Script 1

This script will store all folders in the root of the c: drive in” Results”, separated by semicolons. We assume that the selected value from the picklist is stored in metadata [DIR1].

StartingFolder="c:\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.GetFolder(StartingFolder)
Set SubFolders = Folder.SubFolders
RESULT=""
For each folderIdx In SubFolders
RESULT=RESULT & folderIdx.Name & ";"
Next

Script 2

This script will store all child folders of the folder selected in the first script, and store them in RESULTS. We assume that the selected value from the picklist is stored in metadata [DIR2].

dir1 = Metadata.Values("DIR1")
StartingFolder="C:\Scans\" & dir1
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.GetFolder(StartingFolder)
Set SubFolders = Folder.SubFolders
RESULT=""
For each folderIdx In SubFolders
RESULT=RESULT & folderIdx.Name & ";"
Next

Script 3

This script will store all child folders of the folder selected in the second script, and store them in RESULTS.

dir1 = Metadata.Values("DIR1")
dir2 = Metadata.Values("DIR2")
StartingFolder="C:\Scans\" & dir1 & "\" & dir2
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.GetFolder(StartingFolder)
Set SubFolders = Folder.SubFolders
RESULT=""
For each folderIdx In SubFolders
RESULT=RESULT & folderIdx.Name & ";"
Next

Now all that needs to be done, is create a template, which asks three questions in the capture settings, each question referring to a VB Script to create a picklist, and storing the return value in metadata %DIR1%, %DIR2% and %DIR3%.

Previous Article

General

Next Article

Variables