Hi,
very low temperature Musa acuminate (kool bananas).
I'm going to suggest a wee work-around which will allow some flexibility and yet still remain fairly simple.
As it turns out initialising a string variable in Lua is not that easy because \ is an escape character. So the Lua interpreter is reading a line of text,
it encounters a \ and then treats the remainder of the line of text as an escape sequence. You can get around it by having two \\ in a row, its a bit
confusing and cumbersome.
Instead I'm going to suggest using Machs registers, means its easy to add a line of text with \ in it and also means its a simple edit if you wish to
change the name and/or file path to the Gcode files.
Fire up Mach go to Configure/Plugins/Regfile and click the wee green cross to add a new register. Give it a name like Button1
and as its initial value put C:\Mach4Hobby\Button Codes\Button1.tap You can expand the width of the column to see it if it makes it clearer. Ensure that the 'persistent'
option is checked. Likewise add two new registers Button2 and Button3 with the path and file as initial value. The description is optional and for your use. Hit <apply>
These registers now hold the path and filename, easy. Check now Diagnostic/Regfile and expand iRegs0 and your new registers should be there and if you
click on them you can edit them right there without delving into the GUI event scripts, nice.
I'm dreaming this up as I go...I would normally have a cigarette and a cup of coffee now while I thought some more....but I given up cigarettes...they were
damn handy at times like this.
Craig