Copy link to clipboard
Copied
Hi,
Does anyone know how to manage nested/wrapped objects (items placed in items) in Javascript?
How to check if a pageItem has other items inside? (isolation mode)
var myDoc = app.activeDocument;
for (var i = 0; i < myDoc.pageItems.length; i++){
var myItem = myDoc.pageItems[i];
// How to check if myItem contains isolated items
// How to remove subitems?
}
for (var i = 0; i < myDoc.symbolItems.length; i++){
var mySymbolItem = myDoc.symbolItems[i];
// How to check if mySymbolItem contains isolated items
// How to remove subitems?
}
Thanx
Copy link to clipboard
Copied
Yes.
And the forum search too:
Copy link to clipboard
Copied
The phrase "isolation mode", being in brackets at the end of the post, reads like an afterthought. Is the question about (1) using nested items in general or (2) using nested items with isolation mode? An example of what is being sought would be helpful.
Copy link to clipboard
Copied
The original post has been modified ...
Copy link to clipboard
Copied
var items = app.activeDocument.pageItems;
for (var i = 0; i < items.length; i++) {
if (items[i].parent.name == "Isolation Mode") {
var x = confirm(items[i].name + " is in Isolation Mode. Delete it?");
if (x) items[i].remove();
}
}