Getting started with JavaScript macros in OpenBuilds Control

OpenBuilds Control is a free to use application that allows you to connect and control a grbl based CNC router, laser, plasma or dragknife machine. The application is easy to use and targeted towards the beginner. It has a ton of functionality built in, including wizards for surfacing your spoilboard and calibrating your axis steps, as well as probing routines to help set up your jobs quickly and accurately. Control’s default functionality is more than enough for most use cases, but what if you want to customize a menu item or have a need for your own wizard for a specific job setup? That’s where JavaScript macros come in.


OpenBuilds Control macros come in two flavors; gcode and JavaScript. Gcode macros, as the name implies, are strictly for sending gcode to your controller. JavaScript macros on the other hand allow you to inject JavaScript functions into the app and even replace entire functions with custom code.

Adding JavaScript macros are added using the add macro functionality in the Macros tab. Simply add a new macro, give it a name, click on the JavaScript tab, add your code and save. It couldn’t be easier. The tricky part obviously is writing and debugging the code.


Since Control is a web-based app, press Ctrl + Shift + i to bring up the inspection panel. From there you can paste your JavaScript code directly into the console and look for any errors. I find this easier than editing the macro directly. Once I know my JavaScript is working as expected, I’ll create a macro for it.

I wont go into how to debug JavaScript here, but here are a few references. First, check out the Backend Devtools section of the Control wiki:–Backend-Devtools

Also, Chrome DevTools has a built in debugger. You can learn more about that here:

You can’t right click in the Control app, so if you need to inspect a specific element, the easiest thing to do is open up a browser and go to:


Coming Soon

In the coming weeks, I’ll be releasing videos on how to use OpenBuilds Control macros to add dialog boxes, wizards and menu items. In the meantime, check out this quick video on how to hide the Z jog buttons when the 100mm step size is active.

OpenBuilds Control can be downloaded here.

OpenBuilds Products I Use (affiliate):

OpenBuilds Control​
Workbee 1510​
BlackBox Motion Controller​
Interface CNC Touch Controller​
XYZ Touch Probe Plus


Leave a reply

Your email address will not be published. Required fields are marked *


©2022 Thayne Co


I'm not around right now. But you can send me an email and I'll get back to you, asap.


Log in with your credentials


Forgot your details?

Create Account