loop through job folder (more than one file)

Post Reply
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

loop through job folder (more than one file)

Post 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
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

loop through job folder (more than one file)

Post 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);



}

Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

loop through job folder (more than one file)

Post by ArielRauch »

Gabriel: What would I do without you:)
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

loop through job folder (more than one file)

Post 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')
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

loop through job folder (more than one file)

Post by ArielRauch »

all good - The download folder is the only one that is not working
Post Reply