Export Pages To Subfolders

Script for Adobe InDesign
Latest update 10/17/2021, version 1.7

This is a variation of the script Export Named Pages, altered to instead export pages using the same file name, but each page saved to a unique subfolder that is named based on page content.

NEW as of version 1.5: export interactive PDF.

  • Name subfolder by paragraph style or character style
  • Name subfolder by image or image object style
  • Export JPG, PDF (interactive or print), or PNG
  • Export Print PDF using any PDF Preset
  • Save and restore all settings
  • User-configurable localization
Export Pages To Subfolders
Download
Export Pages To Subfolders

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

How to use the script

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

Section 1: File name

Enter the desired file name shared by all pages exported. The default value is the name of the document.

Reset — restores file name to default (document name without extension).

Section 2: Folder

Root — the root folder to which subfolders are added, into which pages are exported. The default is the folder where the InDesign document is located. Click the button to select another folder.

Subfolder name method:

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

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

Object style — for each page, the first image found on the page that is assigned the selected object style uses the image file name without extension to name the subfolder.

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

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.” Use the next option to instead search from lowest to highest in stacking order.

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.

Section 4: Output

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.

PDF format only: Single or Front+Back — PDF output has the option to export either 1 or 2 pages per PDF, to group front and back together in one file. When exporting Front+Back, even pages are considered the back, and are grouped with the prior odd page. File names are determined by the odd pages, and anything that indicates file name on even pages are ignored.

Export PDF single or front+back

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 are JPG, PDF (interactive), PDF (Print), and PNG. Each format offers different options described next.

JPG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choose RGB, CMYK, or Gray.

Quality — choose Maximum, High, Medium, or Low.

Embed Profile — embeds the current color profile.

Bleed — includes document bleed, if any.

PDF (Interactive)

Resolution — pixels per inch for images.

Quality — image quality. Choose Maximum, High, Medium, or Low.

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 all PDFs are exported. When exporting a great number of pages, it is best to disable this option.

PDF (Print)

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 all PDFs are exported. When exporting a great number of pages, it is best to disable this option.

PNG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choose RGB or Gray.

Quality — choose Maximum, High, Medium, or Low.

Transparent — areas of the page uncolored are transparent.

Bleed — includes document bleed, if any.

A note about JPG and PNG: there isn’t an option for anti-alias because the script always enables anti-alias when exporting either image format. I couldn’t imagine a need to disable the option considering that without anti-alias, the result is horrible. But perhaps I could be wrong, and there is a need to disable it. Contact me to share other views on the subject.

Section 5: Settings

The current options may be saved and restored later. Select from the Load drop-down list to choose saved settings, and the current options are updated. 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. Or click the checkbox Replace settings, and choose the settings to replace.

When settings are saved, there is also the choice to include File name and/or Output folder.

Export Pages To Subfolders Save settings

If the saved settings for a project always uses a particular file name and/or always output to a particular folder, either or both of these choices may be enabled and the values are preserved. If omitted, when the saved settings are loaded, the file name and/or output folder are set to the default value (active document name without extension, and folder where document is located).

The script provides default saved settings named [Default]. These settings cannot be deleted but may be updated to the current values. Save settings, click the checkbox Replace settings, and choose [Default].

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.

Localization

The script provides user-configurable localization. By default the script language is US English, which does not require further download or configuration. For other languages, download the Language Pack and copy the i18n file for the desired language to the script folder alongside the script file. When launched, the script detects the i18n file and the interface displays the language. If the desired language is not present in the language pack, edit the English i18n file to translate to the desired language, and copy the edited i18n file to the script folder alongside the script file. For details of how to edit and install i18n files, read How to Localize Scripts.

Download
Export Pages To Subfolders

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.