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

Post Reply
mcolmenero
Newbie
Posts: 19
Joined: Tue Feb 14, 2012 12:18 pm

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

Post 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
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

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

Post by dkelly »

var folder = new Dir();

folder.mkdir(rutafin);
mcolmenero
Newbie
Posts: 19
Joined: Tue Feb 14, 2012 12:18 pm

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

Post 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
freddyp
Advanced member
Posts: 1022
Joined: Thu Feb 09, 2012 3:53 pm

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

Post 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.
Post Reply