Tutorials, tools, scripts and samples for scripting Acrobat and PDFpdfscripting.com
HomeVideo TutorialsCopy-n-Paste ScriptsDownload LibraryFree ContentSearchMEMBERS LOG-IN
Home | Instructions for Installing Folder L . . .

Instructions for Installing Folder Level Scripts (Automation Tools) and Plug-ins

Printer-Friendly Format

There are a number a different ways to automate document processes within Acrobat, including "Actions" (Batch Sequences) and external Visual Basic applications, but the most common automation tools are Folder Level Scripts and Plug-ins. This document provides descriptions and manual installation instructions for these two types of automation tools.

Folder Level Scripts

A Folder Level Script is a plain text file containing JavaScript code and has a ".js" file name extension. A Folder Level Script is extremely useful for automation for several reasons. A script is fast and relatively easy to develop, it has access to many high level features in Acrobat, it is one of the few automation methodologies that works easily with the free Acrobat Reader, and best of all JavaScript works the same on Macintosh as it does on Windows. It is nearly 100% cross-platform compatible. Unfortunately, much of the Acrobat JavaScript model used in automation scripting does not operate on mobile systems, such as Android and IOS phones.

For Acrobat/Reader to use the JavaScript code it must be placed in one of the two Acrobat JavaScript folders. Acrobat has one "user" specific JavaScript folder and one "app" (short for application) JavaScript folder. Scripts placed in the "user" folder are only available to that user. The "user" folder is located in the user specific area of the local file system. The exact path to this location depends on the operating system and can be found using the techniques described below. Scripts placed in the "app" folder are available to all users on the system. The "app" folder is located in the Acrobat installation area. Again, the exact path to this location depends on the operating system.

Acrobat loads and runs JavaScript files placed in these folders when it starts up. The files must be placed at the root of these folders. Acrobat will not touch files placed in a sub-folder. It will also ignore files that do not have the ".js" extension. The files must contain plain text formatted JavaScript code that is compatible with the Acrobat JavaScript DOM (Document Object Model).

Installing a Folder Level JavaScript File

A JavaScript file is installed with the following 3 steps:
  1. Copy the file containing the JavaScript Code into one of the two Acrobat JavaScript folders. The "User" folder may not exist, in which case it will need to be created manually. See the section below on the "User Folder"
  2. Both folder types can be found by executing a single line of code in the JavaScript Console Window:

    app.getPath(<folder type>,"javascript");

    Replace <folder type> with "app" to find the "app" folder and "user" to find the "user" folder. More details are given below.

  3. Ensure the file extension is ".js".
  4. Close and restart Acrobat.

These seem like very straightforward and simple steps. Unfortunately, there are a number of issues that may cause some difficulty with all of them, including access issues to the folders in the latest Acrobat versions (X, XI, DC) and Microsoft operating systems (XP, 7, 8, 10). Each issue is described separately in the following sections.

Acrobat Shutdown and Restart

Acrobat only loads the Folder Level Scripts when it is first started. So it must be completely shut down before it will recognize and run the JavaScript in a JavaScript file. Shutting down Acrobat can be a problem because there are many scenarios where it will keep running in the background after the user has "Quit" the application. For example, if Acrobat is the default viewer for the browser, then an invisible instance is created when the user opens a PDF in the browser, which may run until the system is rebooted

<b>Figure 1</b> - Use the Windows Task Manager to find and shutdown hidden instances of Acrobat
Figure 1 - Use the Windows Task Manager to find and shutdown hidden instances of Acrobat

If your code does not appear to be loading in Acrobat, then you may need to force Acrobat to shutdown. On any version of Microsoft windows, use the Windows "Task Manager" (shown below) to find and shutdown this hidden instance of Acrobat.

Start the Task Manager:There are several ways to activate the Task Manager, but if you have not used it before the simplest method is to press "Control + Alt + Del", all simultaneously, and then select "Task Manager" from the displayed options. Examine the "Processes" tab: This tab shows all the programs that are running, regardless of whether or not they are visible on the screen. Click on the "Image Name" column header to list the processes in alphabetical order. Then simply select the errant Acrobat or Reader instance and press the "End Process" button, as shown below.

".js" Extension and Folder Visibility

In the newer Windows operating systems the Folder Options are defaulted to hide file extensions and any files and folders it (the MS OS) deems above the user's competence. These settings may make it difficult to navigate to the Acrobat JavaScript Folders. Also, if the JavaScript is transported with a non-JS extension, then these settings will also make it difficult to modify the file extension to ".js".

JavaScript files are code files. Most operating systems as well as all web browsers execute JavaScript, so it can be considered suspicious and blocked from being transported. In fact, Acrobat will not allow an attached file with a ".js" extension to be extracted. I routinely modify JavaScript files to a ".txt" extension so they can be safely transported as a PDF file attachment.

The best solution for handling this folder, file, and extension visibility issue is to change the system settings with these steps:

  1. Open a file folder view of any location on your computer. Any will do, but the best choice is the folder where the JavaScript file will be installed.
  2. Find the "Options" menu item or button in the folder view. For Windows 7 or earlier this will be a menu item on the "Tools" menu at the top of the window. If you cannot find this menu item, try pressing the "Alt" key, shown below.
  3. In Windows 8 the "Options" will be on one of the pulldown links/buttons on the top left corner of the folder view.

    <b>Figure 2</b> - Find the "Folder Options" on any file explorer window, or look it up on the internet.
    Figure 2 - Find the "Folder Options" on any file explorer window, or look it up on the internet.
    Look it up on the internet if you can't find it.

  4. Selecting "Options…" will display the dialog below.

  5. Click the "View" tab.

  6. Make sure the "Show hidden files, folders, and drives" option is selected, and the "Hide extensions for known file types" as well as all the other "Hide" options are unchecked as shown in the image.

<b>Figure 3</b> - Set options to view file extensions and hidden files for all folders.
Figure 3 - Set options to view file extensions and hidden files for all folders.

The Application Folder

<b>Figure 4</b> - How to find the location of the application level JavaScript folder.
Figure 4 - How to find the location of the application level JavaScript folder.

The application JavaScript folder is found by running the code shown in the screenshot at right in the Console Window. In this case the operating system is Windows 7 and the Acrobat version is DC. There will be minor variations for different versions.

For security purposes the "Program Files" folders have restricted access in Windows versions XP and later. The folders are "owned" by the system and require Administrator privileges to access. If the user is not an administrator they cannot place JavaScript files in this folder, and will have to put the JavaScript file in the "user" folder.

If the user is an Administrator, then they can make the process of working with the Acrobat application folders less cumbersome by making themselves the owner of the Acrobat installation folder. Please see the MS Windows help documents (or search the web) on this process, "Taking ownership of a Windows folder".

On Apple Macintosh, the application JavaScript folder is in the configuration file inside the Acrobat Application Package.

The User Folder

Figure 5 - Finding the User JavaScript folder.

The "user" folder is found by running the code shown in the screenshot of the Acrobat JavaScript Console Window at the right. Note that the actual user name has been replaced with "". Since this folder is specific to the user, they have total access and can easily copy anything here. This folder is also shared with Reader, so any scripts placed here will also be loaded into Reader. It seems simple, but there is an issue. If you are already familiar with the Acrobat "user" folders, you'll notice that the path given below is a departure from the normal user path, as shown in the file explorer screenshot to the right.

Figure 6 - On Windows the User JavaScript folder is found in the user area of the file system.

As shown in the folder listing to the right, the Javascript folder is a sub-folder of "Privileged". This folder was added in Acrobat X as a way to provide extra security to the JavaScript files. Before Acrobat X, the Javascript folder was located with the standard user folders.

The unfortunate issue with this folder is that it is not created when Acrobat is installed, so the user will need to create it manually the first time they install a JavaScript file. It is important that the naming is followed verbatim. In this case it is for Acrobat DC, so "DC" is the immediate parent of "Javascripts". Other versions of Acrobat will use different names, which will be the same as the parent for the standard user folders.

Another issue with this folder is that it is used by Acrobat Reader. This can be a good thing, i.e., sharing scripts, but it can also be bad. Many of the automation scripts that can be used in Acrobat will not work in Reader, since Reader has many JavaScript restrictions. As such, it may be desirable to include qualifying code in the script that prevents a folder level script from running if it is loaded by Reader.

Toolbar Buttons

Many automation scripts will create a toolbar button or menu item. These toolbar buttons and menu items look exactly like any other toolbar button or menu item in Acrobat. These are the main entry points for automation scripts. In Acrobat/Reader 9 and earlier, JavaScript toolbar buttons are placed on the "Add-Ons" toolbar (Figure 7). If this toolbar is not visible then Right Click on an empty part of the Acrobat toolbar area and select "Add-Ons." In Acrobat/Reader X,XI, and Acrobat DC, JavaScript toolbar buttons are placed in the "Add-on Tools" Pane in the Tools Panel (Figure 8).

<b>Figure 7</b> - JavaScript Toolbar Button location for Acrobat versions 6 to 9.
Figure 7 - JavaScript Toolbar Button location for Acrobat versions 6 to 9.

JavaScript toolbar buttons were added to Acrobat/Reader in version 6. However, most of the automation scripts that can be downloaded from this site are intended to be used with Acrobat 7 or later. There are some differences in the DOM function that adds toolbar buttons, app.addToolButton().

Some scripts may contain functionality that prevents it from being used in Adobe Reader, on a Mac, or in a particular version of Acrobat. When writing, or using, a folder level automation script always be aware of the environment, and the version and variation of Acrobat the script is intended to be used with.

<b>Figure 8</b> - JavaScript Toolbar Button location for Acrobat version X.
Figure 8 - JavaScript Toolbar Button location for Acrobat version X.


A Plug-in is an Acrobat Add-on created in C++ using a very robust, detailed, and low level library of Acrobat functionality. Plug-ins are not restricted in the same way as JavaScript. They can access the local file system, the internet, and perform operations on virtually every part of a PDF. They can be very powerful and go way beyond the features possible with a Folder Level JavaScript. However, they require a much higher level of programming expertise and are much more difficult to develop than JavaScript. Plug-ins are not cross-platform and require special permission (and a fee) from Adobe to be developed for Reader. As such, I usually only develop plug-ins as part of a larger scripted solution, where the plug-in only performs a narrow task that cannot be done with a script. Or, I'll develop a complete plug-in solution when the total automation task is too far outside the abilities of a script for a mixed solution to be practical.

Figure 9 - On Windows the Plug-ins folder is found in Acrobat Installation Folder.

Plug-ins have a ".api" extension. This extension has no special meaning in any other context so it is non-threatening and not restricted by Acrobat, the operating system, or any browsers. As such it is easily transported.


A plug-in is installed by copying it into the Acrobat "Plug-ins" folder. There is only one Plug-ins folder, and it is in the Acrobat installation area, as shown in the folder listing to the right. There is no "user" Plug-ins folder, however, a plug-in file may be placed in any sub-folder of the main "plug_ins" folder. Sub-folders are a standard method of separating and categorizing plug-ins. In fact, Acrobat creates several sub-folders for the standard plug-ins installed with Acrobat, as can be seen in folder listing to the right.

The file listing on the right is for Windows, but you can find the exact location for any platform by running the code shown in the JavaScript Console Window screenshot below.

Figure 10 - Finding the Acrobat Plug-ins folder. There is only one.

·  Creating Acrobat Toolbar Buttons
·  Beginning Acrobat JavaScript: Introduction to Scripting in Acrobat