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!
-
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();