Page 1 of 1

loop through job folder (more than one file)

Posted: Mon Nov 17, 2014 3:02 pm
by ArielRauch
Can anyone help me out with this "simple" loop.

I want the user to submit one or more files and I want to apply Filestatistics on everyone of them.



Thanks



Ariel

loop through job folder (more than one file)

Posted: Mon Nov 17, 2014 3:29 pm
by gabrielp
This is how I loop through a job folder.





// Check if job folder or a job file

if(!job.isFolder()) s.log(3, 'Job must be an assembled folder.');



// Loop through job folder to create component string

var dir = new Dir(job.getPath());

var jobs = dir.entryList("*", Dir.Files);



// Start job folder loop

for(var i = 0; i < jobs.length; i++){



// Log the job name of what was found

s.log(-1, jobs);



}


loop through job folder (more than one file)

Posted: Mon Nov 17, 2014 3:40 pm
by ArielRauch
Gabriel: What would I do without you:)

loop through job folder (more than one file)

Posted: Mon Nov 17, 2014 3:44 pm
by ArielRauch
what do I have to do on a MAC (talking about the fixture). Can I give the Download Folder for example as the job folder (it gives the error: 11/17/14 16:42,Error,Scripter control,,,,,Can't copy file '/Users/ArielMAC/Downloads')

loop through job folder (more than one file)

Posted: Mon Nov 17, 2014 4:00 pm
by ArielRauch
all good - The download folder is the only one that is not working