stepper motor and switch

Hi
I have copied some code to run a nema 17 with a TB6600, this works well, start the code and motor goes back and forward predetermined number of steps. i would like the motor to do this when a momentary switch is pressed once and the program to work once can someone tell me the code to have this happen please?