Asked • 03/18/19

isPrototypeOf in indesign?

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.

1 Expert Answer

By:

Damini M. answered • 1d

Tutor
New to Wyzant

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.