Remove all alt text
Like everyone, I was affected by the recent bug masquerading as a feature that added a ton of unwelcome AI alt text to every image that I didnt ask for and don't need. Now I have to go through image by image if I want it all out? One of these documents has over 2000 links. I NEED a way to remove all alt text easily. I didn't want it to begin with! Shameful this "feature" shipped at all, let alone without an easy undo! Are you THAT desperate to get your AI adoption number up? Guess so!
-
Bart
commented
@sasha: Haven't tested it, but, according to release notes, version 21.5 added this function:
https://helpx.adobe.com/indesign/desktop/whats-new/release-notes.htmlAlso check this thread about issues for that function:
https://community.adobe.com/questions-671/indesign-21-5-remove-all-ai-generated-alt-text-fails-to-detect-and-remove-existing-ai-generated-alt-text-1636668 -
sasha commented
are there any fixes for this from Adobe without running a random script ?
-
Bart
commented
Greg's script didn't work for me, so I modified chatGPT output, and this worked for me (attachement didn't work, so I'm pasting), it's only looping through linked graphics. Hope it works for you too.
This scripte deletes ALL alt texts, not only AI generated -- please check if this is what you need.
```
var doc = app.activeDocument
var links = doc.linksfor (var i = 0; i < links.length; i++) {
var frame = links[i].parent.parent // Link -> Graphic -> Frame
var opts = frame.objectExportOptionsif (
opts.altTextSourceType == SourceType.SOURCE_CUSTOM // checks if custom text is selected option
) {
opts.customAltText = "" // sets custom text to empty string
opts.altTextSourceType = SourceType.SOURCE_XML_STRUCTURE // returns alt text option back to default
}
}
``` -
Greg Wells
commented
Save this text as a jsx file (I called it RemoveAltText.jsx) and put it in your scripts folder. this script seems to be working for me to remove all alt-text from all images in a document.
(all credit where credit is due, i got this script from the facebook InDesign Secrets group, by Ivy Wood and Jean-Claude Tremblay).
#target indesign
#targetengine "session"
function p(o, n) {
var a, i;
if (!o || !o.reflect) return false;
a = o.reflect.properties;
for (i = 0; i < a.length; i++) {
if (a[i].name === n) return true;
}
return false;
}
function main() {
if (app.documents.length === 0) {
alert("No document is open.");
return;
}
var items = app.activeDocument.allPageItems;
var exportOptions;
var i;
for (i = 0; i < items.length; i++) {
if (!p(items[i], "objectExportOptions")) continue;
exportOptions = items[i].objectExportOptions;
if (
p(exportOptions, "altTextSourceType") &&
exportOptions.altTextSourceType === SourceType.SOURCE_CUSTOM
) {
if (p(exportOptions, "customAltText")) {
exportOptions.customAltText = "";
}
exportOptions.altTextSourceType = SourceType.SOURCE_XML_STRUCTURE;
}
}
}
main();