Varaible File Name

Hi I have prepared a stream that translates to XLM postscript. I want to make a variable as the file name of the first 7 digits of the XML file name of the folders to be created in this stream.

for example

xml files= 3003129_KA_2A.xml,3003129_KA_3A.xml,3003129_KA_4A.xml
xml files=3113129_KA_2A.xml,3113129_KA_3A.xml,3113129_KA_4A.xml

file hierarchy;

3003129
{

  • 3003129_KA_2A.ps
  • 3003129_KA_3A.ps
  • 3003129_KA_4A.ps

}

3113129
{

  • 3113129_KA_2A.ps
  • 3113129_KA_3A.ps
  • 3113129_KA_4A.ps

}

how can I do it?

I’m not sure this is what you need, but the following script extracts the first 7 characters from the job file’s original file name and stores it in a process variable named folderName:

var fileName = Watch.GetOriginalFileName();
var digits = fileName.substr(0,7);
Watch.SetVariable("folderName",digits);