Copy link to clipboard
Copied
How to get the parent page of place xml rectange objects.
myElement.insertionPoints[0].parentTextFrames[0].parentPage . its only wrok for textframes.
Try this code:
if(myElement.insertionPoints[0].isValid == false){
if(myElement.graphics.length == 1){
if(myElement.graphics[0].parent.constructor.name == "Rectangle"){
myElement.graphics[0].parent.parentPage;
}
}
}
Best
Sunil
Copy link to clipboard
Copied
Try this code:
if(myElement.insertionPoints[0].isValid == false){
if(myElement.graphics.length == 1){
if(myElement.graphics[0].parent.constructor.name == "Rectangle"){
myElement.graphics[0].parent.parentPage;
}
}
}
Best
Sunil