Perform same function in PDF


I am looking to loop the same function to be performed on a series of PDFs in a specified file location. I have figured out how to specify the file and open all the PDFs. Now I would like to apply a click path function to make the same property edits to all PDFs in the file and save and close. How can I go about the second half of this?

I dont think it’s a good idea to open all of them at once as that can cause memory issues and could be a problem if it ever fails partway through. Can you instead get an array of the filepaths, then for each filepath open pdf, perform edit, save, close. This will loop through everything one by one until all files are completed