Answered
TOC update only visible layer
hi, is it possible update TOC('s) only in visible layers with a script?
hi, is it possible update TOC('s) only in visible layers with a script?
Hi found the script that updating all TOC in active document and i add the prop .visibile
var myDoc = app.activeDocument;
// Remember the current view
var myPage = app.activeWindow.activePage;
var myObjectsArray = myDoc.allPageItems; // allPageItems returns an array of all objects in the document, even those in groups
var myNumObjects = myObjectsArray.length;
var myNumTOC = 0;
for (var i=myNumObjects-1; i>=0; i--) {
var myObject = myObjectsArray[i];
if (myObject.constructor.name == "TextFrame") {
if (myObject.parentStory.storyType == StoryTypes.TOC_STORY&& myObject.visible) {
myObject.select();
// Update the TOC
app.scriptMenuActions.itemByID(71442).invoke();
myNumTOC++;
}
}
}Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.