Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

388
Views
How to console.dir() on extendScript?

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?.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!