PDF Editing Issues

Use Acrobat Action Wizard JavaScript to Insert PDF Pages

Huda QurayshiHuda Qurayshi Nov 18, 2026 868 views

Question details

The user wants to use JavaScript in Adobe Acrobat's Action Wizard to open the Insert Pages command and add pages from another PDF.

Use Acrobat Action Wizard JavaScript to Insert PDF Pages
Product
Adobe Acrobat Action Wizard
Device & OS
not provided
Scenario
The user is creating an Acrobat action and wants to insert pages from a document in another folder.
Observed behavior
The intended result is to open the Insert Pages dialog during the action and select a source PDF.
Before you start

Make sure your Acrobat edition includes Action Wizard and that you can access both the destination PDF and the PDF containing the pages to insert. Check that Acrobat JavaScript is enabled in Preferences under JavaScript.

Solution 1Recommended

Open Insert Pages with Acrobat Action Wizard JavaScript

Use an Execute JavaScript action to open Acrobat's Insert Pages command while processing a PDF.

1
Create an action

In Acrobat, open Tools > Action Wizard and select New Action. Depending on your version, Action Wizard may appear under All tools as Use guided actions.

2
Add JavaScript

In the action editor, add Execute JavaScript, select Specify Settings, and enter: app.execMenuItem("InsertPages");

3
Save and run the action

Save the action, select it in Action Wizard, and run it on the destination PDF.

4
Choose the source PDF

In the Insert Pages dialog, browse to the other folder, select the source PDF, and choose where to insert its pages.

Open Insert Pages with Acrobat Action Wizard JavaScript
The command opens a dialog: The JavaScript opens Insert Pages; it does not automatically choose a folder, select a file, or insert pages without user input.
Free Microsoft Office alternative

Combine PDF Files and Work with Office Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move existing files. Its PDF tools can help combine documents, but they do not run Acrobat Action Wizard scripts.

Use PDF merge tools to combine documents without writing Acrobat JavaScriptOpen and edit compatible Word, Excel, and PowerPoint formatsNavigate a familiar interface when moving from Microsoft OfficeUse a free, lightweight office suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

What JavaScript opens Insert Pages in Acrobat?

Add app.execMenuItem("InsertPages"); to an Execute JavaScript step in Action Wizard. It opens the Insert Pages command for the current PDF.

Does the script automatically insert a PDF from another folder?

No. The command opens the Insert Pages dialog, where you must browse to the folder and select the source PDF.

Where do I add JavaScript to an Acrobat action?

Open Tools > Action Wizard, create or edit an action, add Execute JavaScript, and select Specify Settings to enter the code.

Can WPS Office run an Acrobat Action Wizard script?

No. Acrobat Action Wizard scripts are specific to Acrobat. WPS Office provides PDF tools for tasks such as combining documents, but it does not run that action.