Historical - Old Komodo Macros and Extensions

Komodo macro and extension development. Share useful code samples.

XUL: Inserting Text into Text Box at Insertion Point

I have a textbox element with an id of “source”.

I have added an onkeydown event handler to intercept the tab key:

        source.onkeydown=function(e) {
                if(e.keyCode==9) {
                        e.preventDefault();     //      so far, so good
                        //      insert '\t' here

In JavaScript, how can I insert a character at the insertion point in the text box?


Snippets SublimeText style

Sup, guys. Is there a way to add my snippets here?
This snippet inserts: echo '<pre>'; var_export(); echo '</pre>'; //debugging

Tools / Extension developer / JS tools broken?

I enter something simple in JavaScript Shell 1.4 but I get no output.

Same with Javascript Dev Env
I hit Execute
(no more output)

What's the current state of the art to debug JS?
Or do I miss something?

Save selected text in a file

How can save selected text, in a file?

what's the right way to initialize an ext?

If you look at


What's the right way to initialize an extension?

function(event) { setTimeout("gKoCtags.onLoad()", 3000); },

seems to be wrong because I cannot be sure that that 3000 is enough to wait for the UI to be built.

Any help/pointers appreciated.

If possible I'd like to do the least amount of changes...

what's wrong with this ext startup? (KO 8.5.3)

Might be I miss something, but my extension fails to find a XUL element.

koctags_ctags_tab is defined in

    <ko-pane id="workspace_bottom_area">
        <browser type="ko-widget" id="koctags_ctags_tab" label="CTags"
                 position="10" insertbefore="codebrowserviewbox"

But there's an exception on startup:

TypeError: this.treeElement is null

Compile LESS on Save -- Macro Help

I have just discovered that the LESS extension is no longer a) compatible with 8.5.3 and b) no longer maintained by the originator. Fine, with syntax coloring recently added to Komodo, I'm almost good.

I want to compile my LESS files on save. I have a macro that invokes the LESSC compiler just fine. It just does a:

ko.run.runEncodedCommand(window, 'lessc %F > %D/%b.css');

This works great. But I want to run that on file save -- IF and only IF the file has a file type of .LESS. I don't have the macro skills to build that macro.

Incompatible themes - is there any way to make them run?

Hello, it's my first post there, I hope that I have chosen the right subforum.

I'm pretty new to Komodo. I have updated it to 8.5 and then I tried extensions for the first time. Extensions database is very impressive, I found few functionalities that I was dreaming of, but some of them are incompatible with Komodo 8.5 (e.g. ColorTab, MySQL Database Explorer or Aero Theme). Is there any wayaround to make them work with 8.5 version?

Sorry, if there is similar topic. I was looking for that information, but I hadn't found it.

PS. I use Windows 7.

Macro: File from Template...

Hello guys,

how can i open a new buffer with predefined content via macro, like "Menu" -> "File from Template...".
The generated macro with the recorder isnt very useful.

I would be thankful for any help.

Enhanced Key Combos

In Komodo Edit 8, I used an autohotkey script to

1. Save current document 2. Change focus to my browser 3. Reload the page

LiveReload works for this, but has a 5 second delay on my machine. I am not sure why.

I also used one to remap CapsLock to only toggle with Shift+Capslock, which allowed me to use CapsLock as a modifier key for other key combos. For example, I used Tab for Komodo Snippets and CapsLock for Emmet.

Unfortunately, I can no longer get autohotkey to work within Komodo.

I. Suggestion, consider offering the CapsLock as modifier option within Komodo.