// Show file path and number of pages
console.println(path + "\t" + numPages);
If you don't want the complete path and just want the file name, do:
console.println(documentFileName + "\t" + numPages);
You could do this with a simple VBScript, using the JSObject to get the number of pages from each document and then outputting to whatever format you want.
Hi, George. I know this is an old post, but I am hoping you can help me. I want to run a script that will allow me to get a batch count of the total pages of multiple PDFs in a folder. It looks like yours above should do the trick, but when I try to run it in the ExtendScript Toolkit, the little blue ball in the bottom right corner keeps spinning to no success. I am attaching a screenshot of the window in case you are able to spot an error. There is only one PDF in my test folder, so I assume it should not take that long to get the page count. Thanks in advance for any help you are able to provide.
That code cannot be used with the ExtendScript Toolkit (I think), but it can be used with a custom Action (formerly known as a Batch process). What version of Acrobat are you using? I responded to you other post, and would use a VBScript for this.
ExtendScript Toolkit can't be used with Acrobat.
Thanks, George. I am using Acrobat DC. I am going to try creating an Action, and I'll let you know if that does the trick.