Question
Select previous page items or next page items (IDCS3)
Hello all,
How can I refer to previous page or its item? I am trying to do something below. if a textFrame with label "myFrame" is missing on current page go to next page (or may try to next page)
for (var i=0; i<=myTotalPage-1; i++)
{
app.activeWindow.activePage =myDoc.pages;
//$.writeln ("Page is :"+myDoc.pages.name);
if(!(myDoc.pages.textFrames.itemByName("sections")!=null))
{
var myText="sometext";
myDoc.pages.previousItem ().textFrames.itemByName("myFrame").insertionPoints.item(-1).properties = { appliedCharacterStyle : "myCharacterStyle", contents:myText};
}
else{
var myText="anotherText";
myDoc.pages.textFrames.itemByName("myFrame").insertionPoints.item(0).properties = { appliedCharacterStyle : "myCharacterStyle", contents:myText};
}
I know that previousItem () is not supported here, just added it to make the things clear.
Any suggestions greatly appreciated.
TIA,
--PC