You write a VB macro, as a custom M-code. You do this by creating a file Mnnn.m1s in the Mach3\macros\Mach3Mill directory. nnn is the M-code number. So, if you create M123.m1s, then you can put an "M123" in your G-code, and that macro will execute. To use that same macro as a Custom Macro in the ShuttlePro, just put the number, 123 in this case, in the configuration dialog.
Regards,
Ray L.