Looping through PDFs in folder - VisualCron - Forum

Community forum

I recently got this program to help automate a bunch of file operations we do every day multiple times a day here at my job. One of the things I need to do is run a batch of commands on a set of PDFs in a folder. I won't try to explain the entire process i'll just list the main steps. I need some help figuring out how to get Visual Cron to read all the pertinent information in each loop and deliver to each successive task.

1. Get list of all files in folder (can be any arbitrary number)
2. Get page count of each PDF separately
3. Rename part of the PDF based on page count for that single PDF

Quick sample

Current files in folder
mytestdata_june2019.pdf - 450 pages
mytestdata_june2018.pdf - 40 pages
mytestdata_june2017.pdf - 50 pages

Result as renaming (keep in mind, these are sample, there are no dates or anything like that, filenames will change, i'm just looking for general guidelines)
mytestdata_450.pdf - 450 pages
mytestdata_40.pdf - 40 pages
mytestdata_50.pdf - 50 pages

1) Add a "List files" task. Filter on eg *.pdf in the searchfolder
2) Add a "PDF - Get information" task. Add a loop to this task that references output from previous task. In the output tab, choose 'PagesCount' in the Show information field.
3 Use the page count from 2), to make the new filename.

Scroll to Top