Skip to main content
nadine wohlfahrt
Inspiring
June 14, 2017
Answered

Extract Alt-Texts

  • June 14, 2017
  • 4 replies
  • 7313 views

Hi everyone,

extracting Alt-Texts directly out of the Indesign-document would be great.

here is my exact Problem right now:

I have an older document, with about 200 pictures with Alt-Texts.

The Alt-Texts are unfortunately entered per hand with the Object-Export-Options in indesign, not in the Picture information itself.

Now we need only the Alt-Texts somehow extracted in a single Text-File or if possible a thumbnail of the pic with its Alt-Text beneath it.

Has anybody a solution for this Problem yet?
I would appreciate a good workflow or workaround without klicking every picture by hand and copy and paste the Text.

Thank you very much in advance

Nadine

Correct answer loyal_operator154A

OK, try this script:

Dropbox - ExportAltText.jsx

https://indesignsecrets.com/how-to-install-scripts-in-indesign.php

So, basically, all you need is to open your InDesign document, then "open" (double-click) on my script.

It will go through all images in the document and get all Alt Text, then save them to the desktop txt file in the format:

IMAGE_NAME

ALT_TEXT

IMAGE_NAME

ALT_TEXT

...

4 replies

Community Expert
January 20, 2022

"Note that Alt-Text with Hyperlinks, new feature in InDesign 2020 version 15.0.0.155, is not supported by scripting.

It is also not supported with IDML or IDMS files."

 

Hi Jean-Claude,

still true with InDesign 2021 and 2022.

 

Regards,
Uwe Laubender

( ACP )

Community Expert
November 28, 2019

Note that Alt-Text with Hyperlinks, new feature in InDesign 2020 version 15.0.0.155, is not supported by scripting.

It is also not supported with IDML or IDMS files.

 

Regards,
Uwe Laubender

( ACP )

jctremblay
Community Expert
Community Expert
January 20, 2022
quote

Note that Alt-Text with Hyperlinks, new feature in InDesign 2020 version 15.0.0.155, is not supported by scripting.

It is also not supported with IDML or IDMS files.


By @Laubender

 

Hi Uwe,  do you know if this is still the case with CC2021, 2022?

 

Bevi Chagnon - PubCom.com
Legend
January 20, 2022

Hyperlinks within Alt-Text is not supported by any standard or assistive technology. Within Alt-Text, the hyperlink is just plain readable text, and the hyperlink is not active nor clickable.

 

Instead, do you mean adding Alt-text on hyperlinks? That indeed is a new feature from 2020 onward, but it still is not exporting correctly to a PDF and, therefore, isn't worth setting at this time. It's a task you'll have to do manually in Acrobat Pro.

 

Note, however, that Alt-Text is NOT required for all hyperlinks. That's a misreading of the standards. Alt-Text is needed when hyperlinks are long and complex, or when it's not clear from the text of the hyperlink or the preceding body text the purpose of clicking the link (aka, where will the user end up if they clicked it).

 

The URL for this webpage is a good example of when Alt-Text is needed.

 

—Bevi Chagnon

US Delegate to the ISO committees for PDF and PDF/UA accessibility, and former contributor to the WCAG web standards

|    Bevi Chagnon   |  Designer, Trainer, & Technologist for Accessible Documents ||    PubCom |    Classes & Books for Accessible InDesign, PDFs & MS Office |
Participant
December 7, 2018

Hello,

This might not be possible but with the Export Alt Text Script above, can this be then reversed after?

After an Export, if I needed to change any of the alt text in the AltText.txt file then import it back to Indesign?

AltText-Export.jsx

//DESCRIPTION: This script will export all all text into single txt document on your desktop.

#target indesign

var images = app.activeDocument.allGraphics; // .itemLink.name

var altTextFilePath = "~/Desktop/AltText.txt";

var file = new File(altTextFilePath);

file.open('w');

for(var i=0; i < images.length; i++){

    file.write(  images.itemLink.name + "\n" + images.parent.objectExportOptions.customAltText + "\n\n" );

}

file.close();

alert('You can find "AltText.txt" file on your desktop', "Done");

loyal_operator154A
Legend
June 14, 2017

So, basically you need to get the plain text out of InDesign, right?

How about this workflow: export to PDF file, then open PDF in Adobe Acrobat and resave as plain text

Alternatively, you should be able to open PDF file in Microsoft Word

loyal_operator154A
loyal_operator154ACorrect answer
Legend
June 15, 2017

OK, try this script:

Dropbox - ExportAltText.jsx

https://indesignsecrets.com/how-to-install-scripts-in-indesign.php

So, basically, all you need is to open your InDesign document, then "open" (double-click) on my script.

It will go through all images in the document and get all Alt Text, then save them to the desktop txt file in the format:

IMAGE_NAME

ALT_TEXT

IMAGE_NAME

ALT_TEXT

...

Participant
January 20, 2023

Great! it worked for me. Also is it possible to add page number?