Running g-code on Arduino without a computer

Here's a pointer to a sketch that reads code from an SD card and sends the gcode to a grbl:

it could be adapted to, for example, send the "button1.gcode" file when button 1 is pressed, etc....