I’m not a legit scripter. These were mostly written with AI’s help, so I can’t vouch for the code—but they work for me. Many are specific to my own workflows, but I thought some other folks might find them useful. (Note: Scripts marked with the icon are mostly (if not only) useful with a keyboard shortcut applied). Use or modify them however you like—and if they save you some trouble and you want to show your appreciation, you can buy me a beer. If you run into any issues with the scripts, you can reach me at lobster [at] lobsterpaws [dot] com. I also take on freelance typesetting, book interior design, and prepress/production work.
apply parent by P style
This script will prompt you to select a parent page and a paragraph style from your document. Any page on which the selected paragraph style appears will get the selected parent page applied to it.
apply-parent-by-p-style.pngchange blank pages to None
This should be pretty self-explanatory. The script will apply the “[None]” parent to any page in the document that doesn’t have any text or art on it. If the blank page has parent items or a page break on it, the script still considers it to be blank.
redefine selected style
A keyboard shortcut is essential here. I find this incredibly useful. It redefines the style without going to the styles panel
clear C styles from selected P style
When I receive manuscripts, headings are almost always locally formatted as bold in Word. After I apply my character styles in InDesign, these have a bold character style applied. When paragraph styles are applied (I use Multi-Find/Change to apply globally, so “clear character styles” isn’t an option) the bold character style is still applied.
clear-c-styles-from-selected-p-style-1.pngIn this example, the paragraph style's font style is Light. Place your cursor in any paragraph using that style and run the script — it will remove the character style from every instance of that paragraph style in the document.
clear-c-styles-from-selected-p-style-2.pngapply P style up to closing tag
Most of the Word files I pour into my InDesign documents use tags to indicate where a new style begins (e.g., <H1>) and ends (e.g., </>). Let’s say I have an extract (<EXT>) in my manuscript, this script will prompt you to enter the tag and select the paragraph style that should be applied to those paragraphs.
apply-p-style-up-to-closing-tag-2.pngThis script applies the paragraph style to all paragraphs between those tags, then removes the tags.
apply-p-style-up-to-closing-tag-1.png
apply-p-style-up-to-closing-tag-3.pngIn this particular example, this doesn’t get you all the way there, but big chunks of text throughout your document are automatically styled and cleanup is much easier. In many cases, however, it is one and done. I recommend temporarily using a unique character color in the paragraph styles you are applying, so they stand out when you're going back through your document.
apply-p-style-up-to-closing-tag-4.pngtext anchor - bookmark by P style
I actually created this one for the InDesign mockup of this web page and thought it could be useful to others. For the hyperlinks, I needed to add a text anchor (and/or bookmark) at the beginning of each red style name, and I wanted those text anchors (and/or bookmarks) to have the same name as the style. Place your cursor in the story, and when you run this script it will prompt you to select a paragraph style.
text-anchor-bookmark-by-p-style-3.pngHit “OK” and a text anchor (and/or bookmark) will be added to the beginning of every instance of that paragraph style, and the text anchors (and/or bookmarks) will be named according to the text of that paragraph style.
text-anchor-bookmark-by-p-style-2.png
text-anchor-bookmark-by-p-style-1.pngpoetry alignment
I like to set blocks of poetry flush left on the longest centered line. For years I did this manually and it was a drag. Now, I just select the block I want to re-align and run the script. If you use this enough, it is definitely worthy of a keyboard shortcut.
poetry-alignment-1.png
poetry-alignment-2.pngset sink rule
I almost always use a “Keep In Frame,” invisible rule to sink items on a page. This script prompts you for an offset value (in picas)—a rough guess for a starting point (default is 6).
set-sink-rule-1.pngOnce you hit “OK,” it creates an invisible rule with the values populated for the proper sink. From there you can create or redefine a paragraph style. For me, it is surprisingly useful.
set-sink-rule-2.pngtracking_gain a line
A keyboard shortcut is necessary for this, but I use it all the time. If I need to gain a line in a paragraph, this script will apply the smallest amount of tracking needed to do so—stopping at +20. Just highlight the paragraph and run the script.
tracking_lose a line
A keyboard shortcut is necessary for this, but I use it all the time. If I need to lose a line in a paragraph, this script will apply the smallest amount of tracking needed to do so—stopping at –20. Just highlight the paragraph and run the script.
toggle no break
This script is most useful if you apply a keyboard shortcut. Going to the Character panel’s hamburger menu was too time-consuming for me, so I made this script to apply/remove manual No Break from selected text.
generate checklist note
I use the Notes panel constantly during the course of a project so I can go back and check or fix things later on in the process. I’m also big on checklists and have a list of things I always check at the end of a job. I made this script to insert a pre-written checklist at the very beginning of my document—it will insert the note wherever your cursor is.
If you open the .jsx file in a text editor, you can customize your checklist starting on line 32. Every line should end with + "\r" + and the last line in the list should end with a ;
generate-checklist-note-1.png
generate-checklist-note-2.pngexport links report
This was conceived by me, but written by a true scripting master, Keith Gilbert. It will export an XLSX report of all links in a document. It offers two options: “Accessibility report” and “File request report.”
export-links-report-1.pngBoth outputs provide a complete list of all links in a document and what page they are on.
The accessibility report has columns for alt-text and extended descriptions and is meant to work in conjunction with Add AltText ExtDescr - Bridge 3.0.
export-links-report-3.pngThe file request report has a column for a user to select images. This is meant to work in conjunction with copy selected links to new location.
export-links-report-2.pngcopy selected links to new location
This was conceived by me, but also written by Keith Gilbert. It was written for when someone needs files for specific, selected images in an InDesign document. They use a two-column XLSX file (see export links report / File request report) with “FILE NAME” and “REQUESTED” heading the first two columns, and a list of all link names is used to request some, but not all, links from a document. In the “REQUESTED” column, they enter “Yes” (or Y, y, yes, YES) for the files they want, and “No” (or N, n, no, NO)—you can even use a Yes/No dropdown—for the files they don't need. Note: All cells must have something entered.
copy-selected-links-to-new-location-1.pngThen you run this script to gather the requestor's files. You will be prompted to select the XLSX file and a location in which to copy the links. Only the “Yes” links will be copied over.
copy-selected-links-to-new-location-2.pngThe export links report output is not necessary to run this script, but your column heads must always be “FILE NAME” and “REQUESTED.”
Add AltText ExtDescr - Bridge 3.0
This one is actually a script for Adobe Bridge, conceived by me and adapted by Keith Gilbert from an earlier script written for me by another master, Kasyan Servetsky—his website is down, but I’m sure you can find his scripts out there.
This script enables you to apply alt-text to files’ metadata via Bridge. Make an XLSX file with columns for “FILE NAME” and “ALT-TEXT”—see also export links report.
add-alttext-extdescr-bridge-3-0-1.pngThen, in Bridge, go to the folder of images, select all, and run the script. It will prompt you to select the XLSX file, then voilà!
Before
add-alttext-extdescr-bridge-3-0-2.pngAfter
add-alttext-extdescr-bridge-3-0-3.pnglink redactor
A colleague recently needed to supply someone with an InDesign file, but without any of the links in their frames—frames intact to retain page make-up. This was the answer.
caption-image alignments
A keyboard shortcut isn’t essential for this script, but it helps. The script will automatically align a caption text frame with an image. Select the image and caption text frame and run the script.
caption-image-alignments-2.png
caption-image-alignments-3.pngYou will be prompted to select a number (1, 2, 3, 7, 8, or 9). The positioning logic is based on the number pad: 1 = bottom, left. 2 = bottom, center. 3 = bottom, right. 7 = top, left. 8 = top, center. 9 = top, right. The default is 2 because that’s what I use most.
caption-image-alignments-1.pngimage DPI report generator
This script creates a .txt file report that lists all files in a document that are under 255 effective DPI.
image-dpi-report-generator.pngpanel divider
I made this for prepping graphic novels for accessibility features, but I can see it being useful outside of that. If you want to break up a link into multiple links without changing the appearance of the page, draw frames around each part you want to isolate—I recommend a small bit of overlap.
panel-divider-1.pngSelect all drawn frames and the underlying image (per page), and run the script.
panel-divider-2.pngpopulate custom alt-text from CSV
The next step in this graphic novel accessibility process is to apply the alt-text to the divided frames. Select a frame and run the script. You will be prompted to select a CSV file and the cell in which the alt-text lives.
populate custom alt-text from CSV - 1.png
populate custom alt-text from CSV - 2.pngClick “OK” and the altext is applied to the selected panel.
populate custom alt-text from CSV - 3.pngexport multiple PDFs by range
This script will export multiple PDFs from a document and give you the option to name each individual PDF. Enter page number/range and file name separated by a pipe with spaces on either side.
export-multiple-pdfs-by-range.pngexport two PDFs at once
My clients often want a high-resolution and low-resolution PDF for every round of proofs.
export-two-pdfs-at-once.pngpackage file with two PDFs
Like export two PDFs at once, this script will package a file and let you select two PDF export presets and name each PDF.
package-file-with-two-pdfs.pngexport PDF - only pages with links
This script will export PDF(s) of only the pages in your document that have links. It can be exported as a combined document or individual pages. If the latter, it will add the page number to the end of the file name.
export-pdf-only-pages-with-links.png
