Page 1 of 1

Count value of PDFs on top level of job folder

Posted: Wed Jun 16, 2021 7:06 pm
by RunDontStop
This is a follow up to a question I asked earlier. I know I can filter out PDFs on the top level of a folder. If I ungroup, I can direct files from the top level using
[Job.PrivateData:Key="<Ungroup>.FilePath"] Does Not Match .+ (RegExp)
From there I filter out PDFs. So if the job has three PDFs on the top level, the end folder receives those 3 PDFs. Any other PDFs in subdirectories are not included.
Now for complicated reasons what I want is the number of these PDFs on the top level, accessed as private data. My test job has 6 PDFs total, but only three on the top level.
By using the app Filetypes Counter, I can get the 6 value:
[Job.PrivateData:Key="<filetypes>.pdf.count"]

This returns 6. But somehow, I really need the 3 count. Of course the number could change with every job. I might have a job with 12 PDFs on top level, and then 24 more in subdirectories. I know I can ungroup and redirect the 12 PDFs, and I can get the number value 36. But I need that number 12.

Not to get too deep, but in the end I will want to create a new group of these top level PDFs, and I want Switch to know the group is ready to create when the proper number of PDFs arrive. So I really need that number value to trigger Assemble Job. I hope that makes sense.

Re: Count value of PDFs on top level of job folder

Posted: Thu Jun 17, 2021 8:25 am
by freddyp
Using the app Filetypes Counter is the correct approach: it has a property "Subfolder levels". The default is "All", but it has the option "Root level only". There is even a "Custom" option that allows you to specify from what level to what level you want to count.

Re: Count value of PDFs on top level of job folder

Posted: Thu Jun 17, 2021 5:24 pm
by RunDontStop
Thank you this is a huge help.