Summary: Let’s construct an effective ChatGPT prompt that generates standards-compliant alt text for images. We can then embed that text in the images’ metadata for use by Adobe InDesign and other apps. Also, if you’re on a Mac, we can use the Apple Shortcuts app to automate this task for multiple images in one step.

Composing a Reasonable Description

How would you describe the image above to someone who cannot see it? If I place this photo into Adobe InDesign, that software can produce the following automatically:

A rhino is standing in front of a fence.

Meh. That text is technically true and is definitely succinct. But this fails to hint at the image’s intent. We want more but still a concise, hallucination-free, and Web Content Accessibility Guidelines (WCAG)-compliant response without any initial “image of…” or similar. I have found the following to be an effective ChatGPT prompt:

Provide alt text for the attached image, with the following constraints:
Ensure the alt text is concise and WCAG-compliant.
Describe only what is depicted and relevant to the image's intent, not decorative details.
Accurately quote any relevant text that appears in the image.
If the image is entirely decorative, explicitly state that.
Provide only the alt text with no preamble.

With that prompt, ChatGPT generates this:

A fenced tree with grass in a sandy desert, a “DO NOT ENTER” sign on the fence, and a rhinoceros standing outside.

I think that’s significantly better! I’d like to do this for most if not all images I use for InDesign projects and online posts. Getting that text into image metadata can help.

Leveraging Metadata

If this text were in an image’s metadata, InDesign could use it automatically as alt text in exported PDFs and ePubs. More on that shortly. To access and edit image metadata, I can use the Metadata panels in Adobe Bridge or Lightroom, or File Info in Photoshop, pasting the alt text into the Description or Alt Text (Accessibility) fields.

It would great to have a method to get that alt text into the metadata quickly, like with a couple clicks, and for multiple images more or less at once.

Automating the Process

I work primarily on a Mac. Apple provides multiple ways to automate actions and workflows including AppleScript, Automator, and the Shortcuts app. I decided to create a Shortcut that could be triggered by right-clicking and choosing the shortcut. This shortcut creates smallish JPEGs of whatever images are selected and sends those and the prompt above to ChatGPT. The response is alt text that gets inserted into the original images’ Description metadata field. (Sadly, the functions used by the shortcut don’t yet support the Alt Text field, but using Description isn’t bad.) Below is a link to download the Shortcut. Of course, it is provided "as is" without warranty of any kind, explicit or implied.There are things you need to do on your Mac to help ensure it works. It’s a few steps, but that’s because there are lots of settings seeking to protect you. If you’re comfortable doing so, access your Mac’s System Settings and do the following:

  • Make sure Apple Intelligence is enabled

  • In the Apple Intelligence settings, enable ChatGPT. You do not need to sign in to a ChatGPT account (great for privacy), but after a number of uses, access will be throttled.

  • In Privacy & Security settings, go to Full Disk Access. Use the plus sign at the bottom to add the Shortcuts app and (weirdly) Finder. For Finder, after hitting the plus sign, use the search field at the top to access Finder. Both apps will need to restart for settings to take effect. Don’t be too disconcerted when all your icons blink off for a few seconds!

  • Launch the Shortcuts app and access its settings (Shortcuts menu > Settings…) then choose Advanced: Enable Allow Running Scripts.

  • In the Shortcuts app, choose File > Import choosing the downloaded file.

  • In the Shortcuts app, , double-click the name of the Shortcut to see its settings (See figure below). Click the info icon in the upper-right, then enable Finder under Quick Action. This will allow you to run this action by simply right-clicking on one or more images you’ve selected.

  • The first time you use the Shortcut, you may be asked to grant even more permission to do stuff. Choose to Always Allow!

In this Shortcuts settings, enable Quick Actions in the Finder. Then, you can select one or more images, right-click and choose Quick Actions > Generate Alt Text (see below).

The Shortcut added to Quick Actions context menu. Easily generate alt text and embed in metadata by right-clicking one or more selected images.

In InDesign

InDesign’s Object Export Options window

To add alt text to images in InDesign, we use Object menu > Object Export Options. This window may be left open (if you have room on screen) so you may select one image after another and set desired settings. These settings may also be incorporated into Object Styles. Even faster would be using Find/Change to apply either an Object Style or specific Object Export Options to graphics frames (figure below).

You can learn about the power of Find/Change, Object Styles, and other settings in our InDesign Foundations & InDesign level 2 classes, of course.

InDesign’s Find/Change configured to use the metadata Description as the source of alt text

Reply

Avatar

or to participate

Keep Reading