A guide to the use of 3 InDesign scripts and 1 Acrobat batch sequence for accessibility tagging and for authoring and applying alternative text to images and document information metadata
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Guide to InDesign scripts for enhancing 508 accessibility of pdfs
1. www.matthewmariani.us
guide
to scripts for accessibility tagging
and for applying alt text and doc info
These scripts are for use with InDesign CS5 and Acrobat 9
on the Macintosh platform.
THESE SCRIPTS ARE MADE AVAILABLE ON AN “AS IS”
BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED.
2. www.matthewmariani.us
Overview
(1) tagDocumentPlus.jsx (InDesign) – Tags all placed graphics in
the active InDesign document as either Artifacts or as Figures
with an Alt attribute. Also maps all paragraph styles to xml tags.
(2) makeAltTextForm.jsx (InDesign) – Creates an interactive pdf
of a document tagged using tagDocumentPlus.jsx for gathering
alternative text for images and document information.
(3) _finishAltTextDocInfoFormProcessing.sequ (Acrobat) –
A batch sequence to complete processing of the interactive pdf.
(4) importAltTextDocInfoFromFDF.jsx (InDesign) – After the
interactive pdf form is filled out, its form data can be exported
from Acrobat to a form data file. This script maps these data
back into the original InDesign document.
3. www.matthewmariani.us
tagDocumentPlus.jsx
Before running this script:
Open an InDesign document. The script affects the active document.
What the script does:
(1) Tags every untagged, placed graphic on a master page
as an Artifact.
(2) Tags every untagged, placed graphic on a publication page
that has a file name containing the character string “_art” or
“art_” (case insensitive) as an Artifact.
(3) Tags every other untagged, placed graphic as a Figure and
creates an Alt attribute for the Figure tag to hold alternative text.
4. www.matthewmariani.us
tagDocumentPlus.jsx (continued)
What the script does (continued)
(4) Removes any existing styles-to-tags mappings.
(5) Creates new styles-to-tags mappings for all paragraph styles:
• By default: every paragraph style is mapped to the P tag.
• Exception: paragraph styles that have names that contain
the character sequences “H1”, “H2”, “H3”, “H4”, “H5”, and
“H6” are mapped to tags with these names.
(6) Every paragraph is tagged according to these new mappings.
5. www.matthewmariani.us
tagDocumentPlus.jsx (continued)
Take note:
• Graphics that were tagged prior to running the script
are NOT re-tagged.
• Previously tagged graphics are given an Alt attribute ONLY IF
they do not already have one. No existing Alt attribute is altered.
• The script can be run again, if additional graphics are placed in
the document after tagDocumentPlus.jsx was run.
• tagDocumentPlus.jsx can be used by itself, without the other
scripts.
6. www.matthewmariani.us
makeAltTextForm.jsx
Before running this script:
Open an InDesign document that has been tagged using the script,
tagDocumentPlus.jsx. The script affects the active document.
Overview:
The script creates an interactive pdf from the active InDesign
document. The pdf is then transformed into a fillable form with
an Acrobat Batch Sequence. Using Adobe Reader, a subject
matter expert may use the form to author alternative text for
images tagged as Figures and elements of document information,
including title, author, description, and keywords.
Form data are mapped back into the InDesign file using the script,
importAltTextDocInfoFromFDF.jsx
7. www.matthewmariani.us
makeAltTextForm.jsx (continued)
What the script does:
(1) Checks for tagging problems in the document.
(2) Advises the user on corrective action needed if problems are
found, and aborts the script. Problems include:
• Untagged placed graphics.
• Tagged graphics lacking Alt attributes.
• Graphics tagged as something other than ‘Figure’ or ‘Artifact’.
• Missing Alt text identifiers (which are created by the script,
tagDocumentPlus.jsx).
(3) If no problems are found, an interactive pdf is created, and
Acrobat activates and opens its Batch Sequences palette.
8. www.matthewmariani.us
makeAltTextForm.jsx (continued)
Take note:
• This script creates a new, temporary layer on which form field
buttons are created. This layer is removed after the pdf is
created but before the script finishes. The script does not alter
anything else in the document.
• Long documents with many images may take several seconds
to process.
• Once tagDocumentPlus.jsx has been run, changing any of the
document settings for Facing Pages, Allow Document Pages
to Shuffle, or Allow Selected Spread to Shuffle will make the
interactive pdf created by makeAltTextForm.jsx unusable as
a form.
9. www.matthewmariani.us
_finishAltTextDocInfoFormProcessing.sequ
This file is an Acrobat Batch Sequence essential to complete
processing of the interactive pdf produced by the script
makeAltTextForm.jsx.
Before running this batch sequence for the first time:
You will need to put the file,
_finishAltTextDocInfoFormProcessing.sequ, in the correct folder
so it will display as an option in Acrobat’s Batch Sequences
palette as _finishAltTextDocInfoFormProcessing. The location is
normally:
/Macintosh HD/Users/YOUR_USER_NAME_GOES_HERE/
Library/Application Support/Adobe/Acrobat/9.0_x86/Sequences/
10. www.matthewmariani.us
_finishAltTextDocInfoFormProcessing.sequ
(continued)
Run the batch sequence in Acrobat:
(1) Highlight the name of the batch sequence in the Batch
Sequences palette by single clicking on it
(2) Select ‘Run Sequence’
(3) Select ‘OK’ ( File selection dialog opens )
(4) Browse to and select the pdf file to process
(5) Select ‘Select’
(6) Read custom dialog that opens
(7) Select ‘OK’
11. www.matthewmariani.us
_finishAltTextDocInfoFormProcessing.sequ
(continued)
Take action:
After the batch sequence completes: Open the pdf, and enable
extended rights in Adobe Reader so that the person filling the form
can save the form field data using Adobe Reader.
Acrobat Menu: ‘Advanced >> Extend Features in Adobe Reader...’
Select ‘Save Now’, then ‘Save’, then ‘Replace’.
Take note:
The file, codeForAcrobatBatchSequence.txt, contains the JavaScript
code included in _finishAltTextDocInfoFormProcessing.sequ.
12. www.matthewmariani.us
importAltTextDocInfoFromFDF.jsx
Before running this script:
A subject matter expert or editor will need to fill in the alternative text
and document information in the interactive pdf form, save it, and
return the pdf to the InDesign user.
Open the completed pdf form document in Acrobat.
Export the form data to an fdf file using:
Acrobat Menu: Forms >> Manage Form Data >> Export Data...’
What the script does:
(1) Prompts the user to select the form data file (fdf) containing alt
text and doc info for the active InDesign document.
13. www.matthewmariani.us
What the script does (continued)
(2) Assigns alternative text from the fdf data source to all of
the images tagged as Figures for which alternative text was
provided.
(3) Populates the InDesign document’s title, author, description,
and keywords metadata elements if the data were provided.
(4) Identifies instances of missing alternative text for images or
missing document information, if any, and alerts the user.