I’ve written a couple of posts on assembling and communicating with the 2418 CNC mill. This new post summarises how to make your workflow a little more efficient by automating the process of opening a web-based G-Code sender, that relies on a Serial Port JSON Server to communicate with the Mill. If that last sentence doesn’t make any sense, please read my previous post first: How to get a 2418 CNC mill moving.
Let’s automate the launch of JSON Server and G-Code Sender
It’s a bit tedious having to start the JSON server manually then launch the G-Code sender manually. Let’s automate it using Apple’s Automator. Automator is a program that lets you create other little programs, to automate routine tasks.
Here is a screenshot of Automator, showing what we’ll end up with. Step by step instructions are below.
Step by step
- Open Automator (find it in your Applications folder) and create a new Application.
- In the far left-hand column navigate to Utilities.
- From the second column, drag Run AppleScript into the empty pane on the right.
- Change the script as pictured below, (update the path as appropriate, wherever you’ve put your serial-port-json-server file).
- Next, select Internet in the far left-hand column.
- Drag Get Specified URLs into the right pane, underneath the Run AppleScript you just added.
- Remove the apple.com URL. Add http://chilipeppr.com/grbl (or whatever url you want to open).
- Add another Run AppleScript below Get Specified URLs.
- Enter the script as pictured below. (I’m using Chrome)
- Save the file as an application.
- Try it out! It should launch a new Terminal window (just minimise this), and Chilipeppr website in Chrome browser. Ready to go.
Changing the app’s icon
Let’s make the icon for our new app a little more relevant.
- Find an image you’d like to use for the icon. I googled milling icon and downloaded this one. It’s a PNG file, 200×200 pixels.
- Open the icon in Preview. Select All (CMD + A) and copy (CMD + C).
- Find the folder in which you saved the new Mill Control application.
- Right click on the file and Get Info.
- LEFT click on the file’s icon. A blue outline will appear around it.
- Paste (CMD + V). The icon should change. If this doesn’t work, check your file type/size. (Not sure why the file size changed, maybe it’s the addition of the icon.)
- Then I put the Mill_Control.app in my Applications folder, and dragged a link to the dock, next to my CAD program Fusion 360. So it’s all together, ready to go!