I see you edited, if you already have that code then all you do is put it into a notepad file and save as something like M123.m1s and place in your profiles macro folder. Then every time you call m123 from your code it will do that routine.
Hood
Thanks for that....so you are saying I can just insert the line into the gcode, for example...
G0 x10 y-20
m123 (i.e. call auto tool zero macro from within gcode file)
G0 x20 y-40
.....etc?