How to Run Adobe Acrobat Action Wizard Only for Matching Filenames
Question details
The user needs to configure an Acrobat Action Wizard workflow to convert only specific PDF files in a batch, specifically those whose filenames end with a particular suffix like 'CP' (Customer Print files).

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Running a batch processing task on a folder of PDFs but limiting the conversion action exclusively to files that match a specific filename naming convention.
- Observed behavior
- The Action Wizard processes all files in a folder by default. The user requires a JavaScript condition to filter the files by suffix before executing the conversion command.
Ensure you are using Adobe Acrobat Pro, as the Action Wizard and custom JavaScript execution capabilities are not supported in the free Adobe Acrobat Reader.
Add a Custom JavaScript Step to the Action Wizard
Insert a JavaScript step into your Acrobat Action to test the filename using a regular expression. The action will then only execute the save or conversion process if the filename matches your specific criteria.
To prevent Adobe Acrobat from converting every file in a target folder, you can use a case-insensitive regular expression inside a JavaScript step. The script reads the document's filename and conditionally executes the save command only if the required suffix is present.
Launch Adobe Acrobat Pro, navigate to the 'Tools' tab, and click on 'Action Wizard' to open the workflow pane.
Click 'New Action' to create a workflow from scratch, or select an existing action from your list and click 'Edit'.
In the left panel under 'Choose tools to add', expand the 'More Tools' category. Click 'Execute JavaScript' and use the plus icon to add it to your Action steps. Ensure the 'Prompt user' checkbox is unchecked.
Click 'Specify Settings' on the JavaScript step and enter your condition. For example, to convert files ending in 'CP' to JPG: if (/CP\.pdf$/i.test(this.documentFileName)) this.saveAs({cPath: this.path.replace(/\.pdf$/i, '.jpg'), cConvID: 'com.adobe.acrobat.jpeg'});
Click 'OK' to save the script, then save the Action itself. When you run this Action on a folder, it will silently evaluate each file and only convert the ones that end with 'CP'.

Batch Convert Specific PDFs Without Writing Scripts in WPS Office
If writing and debugging JavaScript in Adobe Acrobat feels too complex, you can easily handle targeted batch conversions using WPS Office. Its intuitive interface lets you quickly select your desired files and convert them in bulk without a single line of code.
- 1. Filter Files in Your OS: Open your computer's file explorer (Windows Explorer or Mac Finder), navigate to your PDF folder, and search for '*CP.pdf' to isolate your Customer Print files.
- 2. Open WPS PDF Batch Tool: Launch WPS Office, go to the 'Tools' tab, and select 'PDF to Picture' or your desired batch conversion tool.
- 3. Drag and Drop to Convert: Highlight the filtered files from your file explorer, drag them directly into the WPS conversion window, and click 'Convert' to process them all at once.

Frequently Asked Questions
Can I use the Action Wizard in the free Adobe Acrobat Reader?
No, the Action Wizard and the ability to execute custom batch JavaScript are premium features that are exclusively available in Adobe Acrobat Pro.
How do I modify the script to look for a prefix instead of a suffix?
To filter for a prefix like 'Draft', change the regular expression in the test method to /^Draft/i.test(this.documentFileName). The caret (^) symbol indicates the very beginning of the filename.
Will running this JavaScript action overwrite my original PDF files?
No. The provided script uses the saveAs method and changes the file extension to a new format (like .jpg), which generates a completely new file while leaving your original PDF intact.




