Hi am relativly new to indesign scripting and would like to figure out if an object is a subtype of a class. Example: I want to iterate over all page items and take everything that is not a graphic:
layer = app.activeDocument.layers[layerIndex];
for (i = 0; i < layer.allPageItems.length; i++) {
alert(layer.allPageItems[i].reflect.name)
if(layer.allPageItems[i].isPrototypeOf (Graphic) ) {
alert("Graphic");
} else {
....
}
}
howver the if nver matches. Are there any examples of how to use isPrototypeOf
? What do I have to do to test if an object is of a certain type or a subclass of it?
edit: To clarify, I am trying to test if I have an Instance of anything that inherited from Graphic.
But as far as I can see now that seems to be impossible.