Macro to toggle open the command window to list view

Is it possible for a macro to change the command window to the List View? If this is possible, is it also possible for the macro to click on the first error if it existed?

Currently I have macro which runs a ‘compile’ command. I have checked “Show parsed output as text” the only problem is that this does not switch to the list view. Only when I manually press the toggle button, does the list view show.

Here’s the macro’s code:

_part = komodo.findPart(‘command’, ‘Compile’)
if (!_part) {alert(“Couldn’t find a command called ‘Compile’ when executing macro.”); return }
ko.projects.invokePart(_part);

So I am thinking that the marco could then open the List view instead of relying on the Compile command to do it.

All you should need for this is ko.run.output.toggleView();

That works. Is there a way to click on the first item in the list if it exists?

Yes, but unfortunately I dont have time to work out the details right now. I’d suggest you install DOM Inspector. You’ll want to access the window object (.contentWindow) of the xul:browser element that holds your run command output. Then you’ll have to retrieve the tree element that holds your results and use the tree API to select the first entry.

You can use the JavaScript shell from the Developer extension to easily test these API’s.