Hi,
create a macro e.g. m1234.m1s
in your profile macro folder e.g. C:\Mach3\macros\Mach3Mill
config plug in ( see image )
the macro may look like this
Call Code("G0 Z1")
While ismoving()
Sleep 100
Wend
be careful
when you hit the button the Z axis is going to Z0 with rapid traverse
the same when you code m1234 in MDI or within your G code.
The Z0 position depends on your coordinate system setting
( G54 G55 G56 .... G53 G52 G92 )
the safest choice is to use a fix position in G53 ( machine coordinates )
just a thought
Alex