For some workshop, I am tuning tcl settings so I can give every students a pd with libs and special gui menu. In the pd-extended era, I was simply modifiying the command "New" in pd_menucomands.tcl so it would add thoses lines:
pdsend "pd filename $untitled_name-$untitled_number [enquote_path $::filenewdir]" #create new patch
pdsend "#N canvas 0 0 900 600 12;"
pdsend "#X declare -stdpath extra/path1"
pdsend "#X declare -stdpath extra/path2"
pdsend "#X obj 0 0 path/menu_bar" #menu object
pdsend "#X pop 1"
The patch was created and saved with the paths inside the pd file; and no [declare] object was visible, hence, no path object deleted by mistake by user: perfect magic trick.
Now, many things have change in Vanilla pd. The "filename" command disappears replaced by "menunew".
So I need to do:
pdsend "pd menunew $untitled_name-$untitled_number [enquote_path $::filenewdir]" #create new patch
pdsend "#X declare -stdpath extra/path1"
pdsend "#X declare -stdpath extra/path2"
pdsend "pd-$untitled_name-$untitled_number obj 0 0 path/menu_bar" #menu object
But Why the path trick doesn"t work anymore?
When hit the New patch it works but the console say:
#X: no such object
#X: no such object
Is there a way to include the path without adding many objects [declare] automatically for every patch created? I know that I can use a .sh script with path flags but I prefer to keep this way so the native menu "New" of pd will add my special paths in every .pd files created, and add my menu object.