command output to a new editor tab?

View: New views
6 Messages — Rating Filter:   Alert me  

command output to a new editor tab?

by Éric Cholet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm getting my feet wet at using the toolbox. Is there a way to send  
command output to a new editor tab? I often work with unformatted XML  
files. Writing a command to run "xmllint --format %F" was easy, but  
I'd like the result to display in a new editor tab, is this possible?

--
Éric Cholet




_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss

Re: command output to a new editor tab?

by Todd Whiteman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Éric Cholet wrote:
> I'm getting my feet wet at using the toolbox. Is there a way to send  
> command output to a new editor tab? I often work with unformatted XML  
> files. Writing a command to run "xmllint --format %F" was easy, but  
> I'd like the result to display in a new editor tab, is this possible?
>  

Hi Éric,

There is a Komodo macro on the community site that can perform this type
of functionality, see here:
http://community.activestate.com/forum-topic/send-command-output-edit-window

Cheers,
Todd


_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss

Re: command output to a new editor tab?

by Éric Cholet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le 28 juin 08 à 09:37, Todd Whiteman a écrit :

> Éric Cholet wrote:
>> I'm getting my feet wet at using the toolbox. Is there a way to send
>> command output to a new editor tab? I often work with unformatted XML
>> files. Writing a command to run "xmllint --format %F" was easy, but
>> I'd like the result to display in a new editor tab, is this possible?
>>
>
> Hi Éric,
>
> There is a Komodo macro on the community site that can perform this  
> type
> of functionality, see here:
> http://community.activestate.com/forum-topic/send-command-output-edit-window

Very cool, thanks a lot. Now I have my formatted XML file show up in a  
new editor tab. I wonder if it's possible to set that tab's type to  
"XML" instead of "text", so that it would be properly syntax  
highlighted. Also marking the tab as non dirty so that I'm not  
prompted to save it when I close it would be nice. I've searched the  
online help but didn't find anything -- in fact I couldn't find  
information on most of the other stuff used in that macro, is Komodo's  
help known to be incomplete?

--
Éric Cholet




_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss

Re: command output to a new editor tab?

by Shane Caraveo-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Éric Cholet wrote:

> Le 28 juin 08 à 09:37, Todd Whiteman a écrit :
>
>> Éric Cholet wrote:
>>> I'm getting my feet wet at using the toolbox. Is there a way to send
>>> command output to a new editor tab? I often work with unformatted XML
>>> files. Writing a command to run "xmllint --format %F" was easy, but
>>> I'd like the result to display in a new editor tab, is this possible?
>>>
>> Hi Éric,
>>
>> There is a Komodo macro on the community site that can perform this  
>> type
>> of functionality, see here:
>> http://community.activestate.com/forum-topic/send-command-output-edit-window
>
> Very cool, thanks a lot. Now I have my formatted XML file show up in a  
> new editor tab. I wonder if it's possible to set that tab's type to  
> "XML" instead of "text", so that it would be properly syntax  
> highlighted. Also marking the tab as non dirty so that I'm not  
> prompted to save it when I close it would be nice. I've searched the  
> online help but didn't find anything -- in fact I couldn't find  
> information on most of the other stuff used in that macro, is Komodo's  
> help known to be incomplete?

If the buffer is the currentView, you can do:

ko.views.manager.do_ViewAs('XML');

or directly on the view itself;

view.document.language = "XML";

you can mark the dirty state with:

view.document.isDirty = false;

koIDocument.idl is a good idl to review for some of the document level
stuff.

Regards,
Shane
_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss

Re: command output to a new editor tab?

by Shane Caraveo-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Éric Cholet wrote:

> Le 28 juin 08 à 09:37, Todd Whiteman a écrit :
>
>> Éric Cholet wrote:
>>> I'm getting my feet wet at using the toolbox. Is there a way to send
>>> command output to a new editor tab? I often work with unformatted XML
>>> files. Writing a command to run "xmllint --format %F" was easy, but
>>> I'd like the result to display in a new editor tab, is this possible?
>>>
>> Hi Éric,
>>
>> There is a Komodo macro on the community site that can perform this  
>> type
>> of functionality, see here:
>> http://community.activestate.com/forum-topic/send-command-output-edit-window
>
> Very cool, thanks a lot. Now I have my formatted XML file show up in a  
> new editor tab. I wonder if it's possible to set that tab's type to  
> "XML" instead of "text", so that it would be properly syntax  
> highlighted. Also marking the tab as non dirty so that I'm not  
> prompted to save it when I close it would be nice. I've searched the  
> online help but didn't find anything -- in fact I couldn't find  
> information on most of the other stuff used in that macro, is Komodo's  
> help known to be incomplete?

Actually, if you're using the macro in the above forum topic, you can
change the last part inside the if statement to:

var newView = ko.views.manager.doNewView("XML", 'editor');
     newView.scimoz.text = process.getStdout();
     newView.document.isDirty = false;

Regards,
Shane

_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss

Re: command output to a new editor tab?

by Éric Cholet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le 28 juin 08 à 12:56, Shane Caraveo a écrit :

> Éric Cholet wrote:
>> Le 28 juin 08 à 09:37, Todd Whiteman a écrit :
>>> Éric Cholet wrote:
>>>> I'm getting my feet wet at using the toolbox. Is there a way to  
>>>> send
>>>> command output to a new editor tab? I often work with unformatted  
>>>> XML
>>>> files. Writing a command to run "xmllint --format %F" was easy, but
>>>> I'd like the result to display in a new editor tab, is this  
>>>> possible?
>>>>
>>> Hi Éric,
>>>
>>> There is a Komodo macro on the community site that can perform  
>>> this  type
>>> of functionality, see here:
>>> http://community.activestate.com/forum-topic/send-command-output-edit-window
>> Very cool, thanks a lot. Now I have my formatted XML file show up  
>> in a  new editor tab. I wonder if it's possible to set that tab's  
>> type to  "XML" instead of "text", so that it would be properly  
>> syntax  highlighted. Also marking the tab as non dirty so that I'm  
>> not  prompted to save it when I close it would be nice. I've  
>> searched the  online help but didn't find anything -- in fact I  
>> couldn't find  information on most of the other stuff used in that  
>> macro, is Komodo's  help known to be incomplete?
>
> If the buffer is the currentView, you can do:
>
> ko.views.manager.do_ViewAs('XML');
>
> or directly on the view itself;
>
> view.document.language = "XML";

I found out I could just do
  var newView = ko.views.manager.doNewView("XML", 'editor');
>
>
> you can mark the dirty state with:
>
> view.document.isDirty = false;
>
> koIDocument.idl is a good idl to review for some of the document  
> level stuff.

ooh! shiny! very helpful, thanks!

--
Éric Cholet

_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@...
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
LightInTheBox - Buy quality products at wholesale price