I am very new to scripting but I am looking to add to a current script I am using to update TOCs in my book file.
Is there a way to call the chapter number text variable and move its frame to a differnt X,Y position dependent on the chapter number?
So i would like the script to: Update TOCs > Update chapter number text variables > Update location of chapter number text variable frames to its corresponding number’s location (10 different locations possible)
var myBook = app.activeBook;
for(var n=0; n < myBook.bookContents.length; n++)
{
app.open(File(myBook.bookContents[n].fullName.toString()));
for (var i = 0; i < app.activeDocument.allPageItems.length; i++)
{
var myPageItem = document.allPageItems[i];
if(myPageItem.getElements()[0].constructor.name == “TextFrame”)
{
myPageItem.select();
try{
app.scriptMenuActions.itemByID(71442).invoke();
}catch(e){}
}
}
app.activeDocument.close(SaveOptions.YES);
}