I'm trying to apply tags to all the EPS files in the document. My code:
#target indesign
var allItems=app.activeDocument.pageItems.everyItem().getElements().slice(0);
for(var i=0;i<allItems.length;i++)
{
var allInnerItems = allItems[i].allPageItems;
for(var j=0;j<allInnerItems.length;i++)
{
(allInnerItems[j].toString() == "[object EPS]") ?
allInnerItems[j].parent.autoTag() : alert('false');
}
}
The code finds all EPS and applies to their Rectangle objects AutoTag method. But I was given the error: "The object or the parent story is already tagged or cannot be taged". Besides if i choose some rectangle object with EPS and click the function "AutoTag" in user interface, it will work. Maybe somebody knows, what should I do?
Thanks in advance!