Count value of PDFs on top level of job folder

Post Reply
RunDontStop
Member
Posts: 51
Joined: Mon Apr 05, 2021 8:03 pm

Count value of PDFs on top level of job folder

Post 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.
Attachments
snapshot.png
snapshot.png (44.47 KiB) Viewed 2699 times
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

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

Post 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.
RunDontStop
Member
Posts: 51
Joined: Mon Apr 05, 2021 8:03 pm

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

Post by RunDontStop »

Thank you this is a huge help.
Post Reply