- After you add the following code to the JXA code, you can use Safari Web Inspector debugging:
// Debugger;
- Using Safari Web Inspector to view an Array or Object is no clearer than an interactive command line. You can use the following commands for interactive debugging:
Osascript-l Javascript-i
- JavaScript for OS X Automation control MAC OS uielements Automation operation, there is no visual control tree, looking for control is not necessarily convenient, you can use the following command to get a control tree array, it is recommended to copy and paste into a text editor to view. The UIElements property method can be consulted in the Library of the Script editor.
// The entirecontents () command would return every UIElement within an app ' s user interface hierarchy Processabc.windows[0].entirecontents ();
20160220-javascript for OS X Automation debugging Tips