Second screen on Mach, the MDI screen.
Press Teach then do all your commands using the MDI input, when finished press Stop Teach.

Then go to C:\Mach3\Gcode and there will be a file called Teach.tap Rename this file to waht you want as next time you use teach it will over write it, it always calls the file teach.tap.

That's it but you may have to do a couple of tries to get used to Teach, remember that it remembers accurately what you are doing, if you forget to start the spindle on the first try it will not start the spindle when you run the file !