A few days ago I wrote a post showing how to add a keyboard shortcut to open a file browser. But what if you want to completely remove the Open G-Code dropdown menu and add a button to single click to open a file browser? Its easy to do with a javascript macro.
Create a new macro. Give it a name. Click the Javascript tab on left side and add the following code.
$("#controlBtnGrp").prev("div").hide();
var openFileButton = `
<div class="group">
<div>
<button id="file" class="ribbon-button" onclick="socket.emit('openFile')">
<span class="icon">
<span class="fa-layers fa-fw">
<i class="fas fa-folder-open fg-amber"></i>
</span>
</span>
<span class="caption grblmode">Open<br>G-Code</span>
</button>
</div>
<span class="title">File</span>
</div>`
$("#controlBtnGrp").before(openFileButton);
Make sure to enable “Run Macro on startup”.
If you are new to OpenBuilds CONTROL, be sure to check out my OpenBuilds CONTROL tutorial.
OpenBuilds Products I Use (affiliate):
OpenBuilds CONTROL
Workbee 1510 (similar to Lead 1010 or Lead 1515)
BlackBox Motion Controller
BlackBox X32 Motion Controller
Interface CNC Touch Controller
Router11
XYZ Touch Probe Plus