Thanks @whale-av, it looks to work. But I notices that the save process always break the patching experience like writing in a new object while saving exit the texte fill process etc... don't know if there is a way to avoid this... and the original still get saved along with the backup.
I may have find a solution for changing the patch silently, using sys_gui and send pd command in tcl. One of the key might be using the ::pd_menucommands::set_filenewdir command and change the working directory temporally, save the patch, then revert the path back?
But don't know how it works since I tried with ggee/getdir and get errors:
[ggee/getdir]
|
[$1/backup(
|
::pd_menucommands::set_filenewdir $1
|
[hcs/sys_gui]
returns:
(Tcl) UNHANDLED ERROR: bad window path name "/Users/raphael/Desktop/PureData_MEANDRE_2.8_MAC/MEANDRE/extra"
while executing
"wm attributes $mytoplevel -titlepath"
(procedure "::pd_menucommands::set_filenewdir" line 5)
invoked from within
"::pd_menucommands::set_filenewdir /Users/raphael/Desktop/PureData_MEANDRE_2.8_MAC/MEANDRE/extra "
("uplevel" body line 2)
invoked from within
"uplevel #0 $cmds_from_pd"