Page 1 of 1

Create a folder in a specific path and move the job's file

Posted: Tue Nov 06, 2012 2:49 pm
by mcolmenero
Hi,

I want to get NameProper for the job and with this name, I want to make a folder in a specific path and the move the job files. I don´t know how to create a folder. I tried but i haven´t gone on.



The script i use is:



var folderPath = s.getPropertyValue("Ruta" );//take a path where create and leave folder and files.

var carpeta =job.getNameProper();

var rutafin= folderPath+carpeta;

var folder = new Dir(rutafin);// I think that here I have the problem

var nombre = job.getName();

var rutaini=job.getPath()

s.copy(rutaini,rutafin );

job.sendToSingle(job.getPath());



Thanks for you help

Best regards



Miguel

Create a folder in a specific path and move the job's file

Posted: Tue Nov 06, 2012 3:15 pm
by dkelly
var folder = new Dir();

folder.mkdir(rutafin);

Create a folder in a specific path and move the job's file

Posted: Thu Nov 08, 2012 1:23 pm
by mcolmenero
H,

It doesn´t go on.

The variable ruta I put F:/switch/in/,

But script hasn`t make a folder in that path.

What I make wrong?

Thanks

Best regards

Miguel

Create a folder in a specific path and move the job's file

Posted: Wed Nov 14, 2012 12:21 pm
by freddyp
If the script is complete I do not see anything that cannot be done with "Set hierarchy path" and "Archive hierarchy".



In "Set hierarchy path" you set the first segment to [Job.NameProper] and in "Archive hierarchy" you set the root F:/Switch/in and that will create the directory and move the job into it.