Variable Dumper Macro

Macro Monday – a new macro to dig into every Monday!

For quick and simple debugging of code at runtime, I will often use a print or
log statement to check what a variable is set to. This macro quickly creates the
boilerplate for the print statement according to the language I am currently

## Examples

Given this piece of JavaScript code:

window.myvariable = someFunction(x, y, z);

if you place your caret anywhere in the *myvariable* word, then invoke the
macro, you’d see a *console.log()* statement on the next available line:

window.myvariable = someFunction(x, y, z);
console.log(‘window.myvariable: ‘, window.myvariable);

and when using Python code, the macro would generate a *print()* statement

window.myvariable = someFunction(x, y, z)
print(‘window.myvariable: %r’ % (window.myvariable, ))

### Installation

To install the macro simply hit the download button below, then drag the downloaded
file into your [Komodo toolbox](
Once in your toolbox double click the macro to activate it. The macro will
automatically activate itself the next time you start Komodo, you only need to
do this manually the first time.

### Related Materials

* [Komodo Developer Extension](
– play around with JavaScript or Python code in the context of the Komodo window
* [Komodo Macro API](
– to programatically interact with the Komodo editor
* [Editor API](
– the Komodo editor provides a wrapper around the Scintilla API

Recent Posts

Scroll to Top