I want to familiarize with the DOM in extendScript , I want to console.log(certainObject) or console.dir(certainObject) in order to check its properties.
There is a way to console.log() such as $.writeln(certainVariable) but that won't return the properties of that object.
I can use the extendScript toolkit but in the Data Browser I can't identify all the objects.
Going to the documentation is confusing , for instance for this object app.activeDocument.placedItems it list certain properties , but a basic property such as the method app.activeDocument.placedItems.add(); is not there.
Where does that method come from? Inheritance ? , How can I check this?.
The simplest way to get all (?) properties of the object is just to loop through them and to print the result in the console:
var obj = app.selection[0];
var props = '';
for (var prop in obj) {
try { props += prop + ' : ' + obj[prop] + '\n' }
catch(e) { props += prop + ': ???\n' }
}
$.writeln(props.split('\n').sort().join('\n'));
Not sure if it's the best way, but I'm doing it sometimes. )
I saw the solution that does the same and put the result into a panel. It can be done quite easy if you know how to create a panel and to fill it with a text.
As for the methods... Well, I don't know the answer.