I am trying to have a custom button that launches a grasshopper script. I’ve done this many times through the method below with success, but unfortunately in this case, the file path has a space in the string (“Example Path”), which then disrupts the macro as the space is seen as an execute command.
Is there anyway to run this macro so that the space isnt considered in the string? I tried replacing the space in the file path with \040 but this still seemed to execute the command.
! -_RunPythonScript (
import rhinoscriptsyntax as rs
homepath = os.path.expanduser(’~’)
scriptspath = ‘\Documents\Example Path\example.gh’
file_path = homepath + scriptspath
command = "-_Grasshopper _Document _Open "+file_path