Insert M6 into Gcode?

I’m trying to learn and use Advanced Vcarve, and I’m taking it to a Onefinity machine, so I’m exporting it as basic or GRBL gcode.

For that machine, it has a command in the settings to help with bit changes when it encounters an M6 code, the problem I’m running into is that CC doesn’t write basic or GRBL gcode that way. It writes a tool change using M0 to stop the machine and T to indicate a tool change, like this:

X0.1258
Z0.5000
(Advanced…)
M0 ;T302
S20000
G0X0.0478Y0.0367
G1Z-0.0500F12.0
X0.1869Y0.6574F45.0

Is anyone here a code wizard that knows if I could swap out the T, or insert M6 into the code to trigger the Onefinity into running the tool change? Will that work, or is it more complicated than a few lines of code?

Many thanks!

After some testing, I think I’ve found the answer, and it is simple. Replace the line:

M0 ;T302

with

M6 T302

(302 is just the tool number, so it will vary based on the bit you’ve specified) So ya, swap the 0 with a 6 and remove the semi-colon. I’m guessing this is obvious for someone who knows gcode.