Repetier-Server @execute parameters

edited November 2015 in Questions & Answers
I have a question regarding the parameters passed to the executable. Should they be single or double quoted in the g-code (I want to pass a single string that may contain spaces)?
Basically I created a script that expects two arguments - a filename of the g-code file being printed and the current layer.
My g-code files may contain spaces i.e. 'Test Cube 40x40x40' instead of 'TestCube40x40x40' or 'Test_Cube_40x40x40'.
What I put in after layer change g-code in slic3r is

@execute takeSnapshot '[input_filename_base]-[filament_preset]-[print_preset]' '[layer_num]'

The slicer then substitutes these when generating g-code file.

If I have spaces in the first parameter my script gets more than 2 expected parameters.

Hope this all makes sense.

BTW what I also found is that when I put the above @execute snippet in the before layer change it messes up the number of layers calculation (I get ½ of the total layers when uploading to the RS.


  • Anyone? Or have I not stated my problem clearly enough?
  • You need to quote it in double quotes if it contains spaces. This will not work on windows as we split according to quotes and send it as array to a function. As we found out while analysing the question, in windows it is necessary to requote it, while on unix systems it works. From 0.70 on it will then also work for windows, until then add escaped quotes inside the quotes for windows.
Sign In or Register to comment.