Batch processing waiting queue

Hi everyone
My apps is a batch processing using adobe acrobat javascript feature ( by applescript )
But it only process one file at the time
How can i know when the last file is close then i can proceed with the next
Can i monitor the cpu usage for acrobat only ? (Maybe not the right approach ??)
Need advice
thanks

Does Acrobat output a new file? If so, watch for it. If Acrobat modifies a PDF, watch for the date/time change or file size change. Does Acrobat close when it is finished? If so, then you can wait until Acrobat is no longer running. Add something in Adobe Acrobat Javascript that can notify your app when it is done. (Easiest is to create a file and drop it in a folder.) . Another idea is to attempt to open the PDF file (that Acrobat is processing) in write mode and if you get an error indicating that the file is open, then you know Acrobat is still working on it. This method does not always work since Acrobat may not have a write-lock on the file.

Thanks Brandon
RE: The pdf open… & save (overwrite) and close
I’v try by open it by xojo… but its not write-lock… i’ll check in javascript feature if i can enable it manually
otherwise i’ll go by the date and time
Thanks for these different way to check the state