User-Defined variables

  • 391 Views
  • Last Post 04 April 2019
MMSupport1 posted this 04 April 2019

Hello fellow Scansharers,

 

is it possible to create global variables in a vbs script?

F.e.

aString = "A long OCR Zone Text with SubFolderName"

If InStr(aString,"SubFolderName") > 0 Then

Call MetaData.(method to create a variable) %SubFolderName%

Elseif (...)

End if

So then I can use the Windows FileSystem Connector to something like C:\Output\%SubFolderName%\File.pdf

I am open to other suggestions!

Best regards from germany!

 

luca.scarpati posted this 04 April 2019

Hi,

 

yes all is possible without many problem, for example: 

Dim zoneOCR

Dim barcode

Dim value

 

zoneOCR = Metadata.Values("OCR_VALUE")

barcode = Metadata.Values("BARCODE")

 

If Instr(zoneOCR,"Personal") > 0 Then

   value = "Personal"

   CALL Metadata.SetValues("MY_FOLDER",value)

ElseIf Instr(zoneOCR,"Private") > 0 Then

   value = "Private"

   CALL Metadata.SetValues("MY_FOLDER",value)

Else

   value = "Public"

   CALL Metadata.SetValues("MY_FOLDER",value)

   If Instr(barcode,"user check") > 0 Then

      CALL Metadata.SetValues("PLS_VERIFY","Yes")

      CALL Application.log(99,"The barcode contains user check, please verify")

   Else 

      CALL Metadata.SetValues("PLS_VERIFY","No")

   End If

End If

CALL Application.log(99,"Create new MY_FOLDER Variable: " & value)

...it creates a "MY_FOLDER" variable depending on what contains the value of the zone and in addition I added a control on a variable that comes back from a barcode...it creates the variable "PLS_VERIFY" (maybe it is checked in a trigger after the script and if the value is YES you can add the verification trigger)

 

Enjoy the afternoon and greetings back from Italy cool

 

Luca

Close