Published: March 24, 2014Last Updated: June 6, 2017

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

Todd Whiteman

Todd Whiteman

Todd Whiteman is the Development Lead for Komodo IDE. He works adeptly with Mozilla, Python and JavaScript to ensure that Komodo IDE is the IDE of choice for development teams. Todd has been working on Komodo IDE for nearly 6 years, adding components such as the Vi Key Bindings, Distributed Source Code Control, 64-bit Linux builds as well as Remote SSH support into Komodo IDE.