is now part of CreativePro.com!

A Script to Apply Alt Text from Image Captions

6 0

Recently I discussed with a colleague the feature of adding custom alternative text to an image in InDesign in order to export accessible PDFs which enhance the experience of readers with disabilities. This feature, which also lets you use description metadata that is stored with images has been around since CS5.5.

But what if you don’t have any description metadata to draw information from?

empty alt text

As an editorial designer, I mostly work with layouts in which images are accompanied by captions. I thought it would be nice to have the option to quickly transfer a caption’s content to the user-defined alt-text in the Object Export Options dialog box without even opening it.

As I’m not a scripter myself, I asked Peter Kahrel if he knew of a script that could perform exactly that task. He didn’t, but he answered my request with a little script that does exactly what I was looking for. Here’s how to use it:

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.
  1. Select the image and corresponding caption
    alt text script and image caption selected
  2. Run the script and select the alternative text tab in the Export Options dialog box.caption text copied to alt text

Works like a charm! You might think: “What if my image frame and text frame are grouped or even anchored inside a story?“ Don’t worry. The script also handles that.

To be even more efficient, you can assign a keyboard shortcut to run the script. Choose Edit > Keyboard Shortcuts, and in the dialog box, choose Product Area: Scripts.

applying a keyboard shortcut to a script in InDesign

This allows you to quickly go through your document and create custom alternative text for images with the push of a button.

Thank you Peter!

PS: If you find this script useful, please use the Donate button at Peter’s website (found on any of the script pages) where you can acknowledge the vast amount of free scripts he provides that can save you valuable hours of work!

PPS: Read this article for more information about installing scripts on your computer.

If you are logged in with either a free or paid InDesignSecrets membership, the download link appears below.

Not a member yet? Sign up here!
  • Yes, it takes a much higher calling to become a scripture. :-)

  • Naomi says:

    My experience is with ePub and HTML, not PDFs, so the rules might be different, however I suspect the logic is the same. Although setting the alt text as the caption seems like a good solution, in reality it is not recommended. The reading system will simply read the same text twice, causing frustration. You are not providing any additional accessibility by duplicating the caption as an alt tag.

  • J Keeney says:

    Your pop-ups powered by Optin Monster are a real pain. Would you please opt me out so I could visit your sight without continually having to x-out of these large pop-ups

  • mesin jilid says:

    Heya i am untuk utama waktu di sini. Saya ditemukan forum ini dan saya menemukan Ini benar-benar
    berguna & membantu saya keluar banyak . Saya berharap menyediakan sesuatu
    lagi dan bantuan lain seperti Anda dibantu saya.

  • >