3

I'm trying to get all object properties and I use

console.log(object)

But I don't understand where to find output? Is there a special Automator function for logging?


UPD

Using script editor. Calling console.log(object) just output type of object. Is there a way to see list of all properties/values like in web inspector?

enter image description here enter image description here

2
  • Can you use the Script Editor application to debug your JavaScript first? This application has a console that works. Feb 25, 2016 at 21:02
  • @DavidAnderson I tried to use Script Editor, but I don't understand how to see all object's properties. console.log just returns type of the object
    – Tamara
    Feb 25, 2016 at 21:13

2 Answers 2

2

A simple solution that will work in most cases is to just use JSON.stringify(obj) to see the object as a string in the console.

0

Console log messages appear in apple script editor in the lower display area under the messages tab. If it's hidden, show with menu option View, Show Log, Messages..

log an object with

var obj = {x:1, y:0};  
console.log(JSON.stringify(obj));

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .