Use scripts in Revu
Scripts can be created and executed within Revu to easily manipulate PDFs and automate multi-step tasks.
For more information on Revu JavaScript, include a complete API reference Guide, see this article.
- Go to Document >
Script or Batch >
Script. The Script Manager appears with the active PDF (if any) listed in the Files section. - To use a previously saved batch of PDFs, select Load and select the desired file.
-
Revu automatically adds active PDFs to the process. To add more PDFs, select Add and use one or more of the following methods:
- Files: Adds individual files from a network or local drive. Selecting this option causes the Open dialog to appear. Navigate to the appropriate location and select the desired files.
- Open Files: Adds all files currently open in Revu.
- Open Set: Adds all files contained in the current Set.
- Folder: Adds all files in a selected folder on a network or local drive, but not files contained in any of its subfolders. Selecting this option causes the Select Folder dialog to appear. Navigate to the desired folder and select it.
- Folder and Subfolders: Adds all files in a selected folder on a network or local drive as well as all files within any of its subfolders. Selecting this option causes the Select Folder dialog to appear. Navigate to the desired folder and select it.
- By default, any document in the Files list will be affected. To remove a document from the Files list, select it then select Remove.
-
To specify which pages of a PDF will be processed, select it, then select the Pages menu and select one of the following options:
- All Pages: Sets the range to all pages.
- Current: Sets the range to the current page only.
- Custom: Sets the range to a custom value. When you select this option, replace any text left in the field with the page or pages to be printed directly. To enter a custom range:
- Use a dash between page numbers to define those two pages and all pages in between.
- Use a comma to define pages that are separated.
For example: 1-3, 5, 9 will include pages 1, 2, 3, 5 and 9.
- To save this batch for future use, select Save and save the batch to a local or network drive.
- Available scripts are listed in the Scripts section.
- To review or edit one of these scripts, select it and select
Edit. The Script Editor appears. See Using the Script Editor for more information. - To create a new script, select
Add. The Script Editor appears. See Using the Script Editor for more information. - To delete a script, select it and select
Delete. - To add a script to a toolbar, select it and select Add to Toolbar. The Customize Toolbars dialog appears. By default, the Script toolbar will be selected, but scripts can be added to any toolbar available in the Categories menu. See Adding Scripts to Toolbars for more information.
- To review or edit one of these scripts, select it and select
- Select the desired script and select Run.
Use the Script Editor in Revu to create new scripts and editing existing ones. It is reached through the Script Manager, as demonstrated above.
Whether editing an existing script or creating a new one, the following components are available:
Name: Determines the name of the script. Names do not need to be unique.
Icon: Determines the icon used to identify a script in a Toolbar. Click Import to import your own icons, or use one of the standard icons available.
Commit Changes After Running Script: When enabled, the active PDF will apply the changes upon invoking the script.
It is sometimes useful to not commit changes to the currently active PDF. For example, a script could be created that applies headers/footers, adds a cover page, flattens, and then sends an email. By not setting this property, the email will have all the script's modifications, but the active PDF will not. Therefore, you can continue working uninterrupted and your email was sent with all the necessary modifications.
Color: Sets to the color used by the built-in icons.
Script: Enter the commands to be executed with this script. Multiple script commands are supported; enter one script command per line. Each script command may include a series of required and optional parameters for controlling the function.
The Script field utilizes two features to simplify entering scripts: auto-complete and tooltips.
-
Auto-complete: Simply start typing in the Script field and the auto-complete feature will pull up the list of accepted script commands. Double-click one of these commands to select it.
-
Tooltips: Hover the mouse over a command to view tooltips, including parameters and examples. The tooltip will also automatically appear after you type opening bracket of the function or press CTRL-SHIFT-SPACE to bring up the tooltip relevant to the cursor's current location.
While entering script parameters, pressing the TAB key will automatically insert the default parameter.
Once a Script has been created, it can be added to any toolbar in Revu.
- Go to Document >
Script or Batch >
Script. The Script Manager appears with available scripts listed in the Scripts section. - Select the desired script and select Add to Toolbar. The Customize Toolbars dialog appears. Scripts can be added to any toolbar available in the Categories menu.
- Note that the icon that appears in the toolbar is the same one shown in the Scripts section beside the script's name. You can change the icon from the Script Editor. See Using the Script Editor for more information.
- To create a toolbar specifically for scripts, click
Add and enter a name for the toolbar in the dialog that appears.
