Export Named Pages

JavaScript for Adobe InDesign
Latest update 10/12/2020, version 1.0

The script uses the method selected by the user to determine a file name for each page of the InDesign document and exports images or single-page PDFs accordingly. The result is uniquely named files of each page. For single-page PDFs labeled by page number, see the script PDF Export Single Pages.

  • Export pages each with unique name
  • Name by paragraph or character style
  • Name by image
  • Export all pages, a single page, or any range or ranges of pages
  • Export JPG, PDF, or PNG
  • Export PDF using any defined PDF Preset
  • Save and restore all settings
Export Named Pages screen
Download
Export Named Pages

You decide. Reward the author an
amount the solution is worth to you.

Instructions for use

The interface has four sections: Method, Options, Output, and Settings. Set desired options then click OK button to begin. A progress bar is displayed as pages are exported.

Section 1: Method

Paragraph style — for each page, the text contents of the first paragraph found on the page that is assigned the selected paragraph style is used to name the exported page.

Character style — for each page, the first instance of text found on the page that is assigned the selected character style is used to name the exported page.

Image name — the file name minus extension of the first image found on the page is used to name the exported page.

In all cases, “first” refers to the order elements are arranged, first being the highest element in the overall stacking order. This also takes into account layer order. The highest in stacking order, on the highest layer, is considered “first.” To instead search from lowest to highest in stacking order, see the option below, Reverse search.

Examples of how to use methods

Suppose you have a document of multiple real estate agents and properties for sale. Could be dozens of them, or more. Assuming each page has a photo of the agent and the image file name is the agent name, use the image name method and each exported page will be the agent’s name. If pages have more images than just the one image, arrange as needed to make the desired image to use for the name either the first or last in the stacking order, and set the options to match. Or perhaps the output should be named by the property name. Again assuming there is a photo of the property and it is named as desired, use the image name method. Or the same example could use the paragraph style method, if the font style for the agent or property name is unique from other font formatting on the page. If not unique, still a character style could be created and assigned. The character style doesn’t have to alter anything about the font formatting—it just has exist and be assigned so it may be selected for the naming method, in which case the precise text assigned the style becomes the file name of the exported page.

Section 2: Options

Reverse search: match lowest element instead of highest — the elements to search through are reversed before searching, so that “first” to match becomes the lowest in stacking order rather than the highest.

Spaces — when enabled, once text for each page’s file name is determined, spaces within that text are either removed, converted to a dash, or converted to an underscore as selected by the user.

Letter case — when enabled, once text for each page’s file name is determined, that text is converted to either all lowercase or all uppercase as selected by the user.

Section 3: Output

Folder — the folder to which pages are exported. Default is the folder where the InDesign document is located. To override, click the button and select another folder.

Pages: All or Range — controls whether to export all pages of the documents, a single page, or any range or ranges of pages. For a single page or a range, the normal InDesign rules for identifying pages are recognized. Use section and/or alternate layout prefixes combined with the page number as it appears in the layout, or enter the plus sign followed by the absolute page number. Separate the first and last pages of a range with a hyphen, and separate multiple pages or page ranges with a comma.

Replace existing output files — when enabled, existing output files are replaced without user intervention. When disabled, the user is prompted to confirm the replacement of each existing output file.

Format — the file format to which pages are exported. The available choices, JPG, PDF, and PNG offer different options described next.

JPG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choices are RGB, CMYK, or Gray.

Quality — choices are Maximum, High, Medium, or Low.

Embed Profile — embeds the current color profile.

PDF

PDF preset — the PDF preset used to export the pages.

Export in background — when enabled, PDFs are queued to export in the background and the script ends sooner. When disabled, each PDF page is exported immediately and the script is active until exporting all PDFs is completed.

PNG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choose RGB or Gray.

Quality — choices are Maximum, High, Medium, or Low.

Transparent — areas of the page uncolored remain transparent in output files.

Section 4: Settings

The current options may be saved and restored later. Select from the Load drop-down list to choose saved settings, which then updates the current options. Click the Delete button and the saved settings selected in the Load drop-down list are permanently removed. Click the Save button, provide a name for the settings, and the current options are preserved. If the name already exists, the user may choose to replace the saved settings.

The script provides default saved settings named [Default]. These settings cannot be deleted but may be updated to any desired values by saving settings and providing the name [Default], which then overwrites the default settings.

Each time processing begins, the current options are preserved, and the next time the script is launched, options are restored to the last values used.

Download
Export Named Pages

License details included in download

For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.

IMPORTANT: by downloading the script you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.

CHANGE LOG

Version 1.0 (201012)

  1. Initial release.