The documentation for JXA is lacking, so it would be extremely useful to be able to see the methods, variables, signatures, etc of the elements we deal with in the code. Unfortunately I haven't found a way to do this.
Given a JS variable, arising from a JXA script, how can I see all the methods that it contains? I am not familiar with JS, but the standard methods suggested here, console.dir()
and JSON.stringify()
did not work.
Practical example. To create and get the title of a Terminal window I can do
terminal = Application('Terminal')
terminal.quit()
terminal.activate()
delay(0.2)
title = terminal.windows()[0].name()
console.log(title)
My knowledge that I have to call windows()
, and then, after subscripting, to call name()
, came from a code on the web. I would like to be able to see the method windows()
programmatically, like you get when you type __dir__()
in Python.
As said, the methods standard methods listed above did not help.
How can I proceed?