PDF Conversion Issues

How to Run Adobe Acrobat Action Wizard Only for Matching Filenames

Amos GikundaAmos Gikunda Nov 2, 2026 869 views

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).

How to Run Adobe Acrobat Action Wizard Only for Matching Filenames
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the Action Wizard

Launch Adobe Acrobat Pro, navigate to the 'Tools' tab, and click on 'Action Wizard' to open the workflow pane.

2
Edit or Create an Action

Click 'New Action' to create a workflow from scratch, or select an existing action from your list and click 'Edit'.

3
Insert the Execute JavaScript Tool

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.

4
Enter the Filtering Script

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'});

5
Save and Run the Action

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'.

Add a Custom JavaScript Step to the Action Wizard
Customizing the Regular Expression: The expression /CP\.pdf$/i specifically looks for 'CP' right before the '.pdf' extension and ignores case sensitivity. You can change 'CP' to any other suffix your workflow requires.
Easy PDF Batch Processing

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. 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. 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. 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.
No JavaScript or coding skills requiredBuilt-in batch conversion for PDF to JPG, Word, and ExcelHighly compatible with standard PDF formats created by Microsoft Office or AdobeVisual interface to easily drag and drop only the files you want to process
microsoft office alternative - wps office

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.