-
work-around for savepanel / savepanel doesnt work or I dont know how to use it.
-
@willblackhurst From what I can see the [savepanel] and [openpanel] objects never call the tcl variable for the filetypes and just ignores the Files of Types menu completely so even if you use [hcs/sys_gui] to set the variable to what you want it never updates them. Would require editing pd's source to make it work. This seems like a good feature request and worth filing an issue for on the pd git. You could make a custom [openpanel] [savepanel] with a gui plugin without much effort if a plugin is OK for your project. I think I saw in the next release of pd abstractions will be able to load plugins which would make this method work well even with projects you intend to share. Don't have time to throw together a demo of plugin now but it is mostly just copying the code from pd-gui.tcl and using [hcs/sys_gui] in an abstraction to run the new proc and send to a send in the abstraction. I can throw something together later or tomorrow if need be, but you can probably figure it out without much effort.
-
not sure what you are asking really, but yeah, [savepanel] works just right and you can't use it to save Pd files. Help file is really straightforward! "When [savepanel] gets a "bang" a "Save As" file browser appears on the screen. You then to specify a filename, and a symbol with the full patch is sent to the outlet." What is you question?
-
@willblackhurst Actually we can do it without a plugin.
sp-abs.pd
But dealing with tcl's nested lists in pd is a pain because of the lack of curly braces. This may not be a problem if you are not worried about have a drop down list of file types to choose from and can set the type before opening the panel. Would be easier to deal with as a plugin.[list [list pd [list .pd]]]
in the set message can be edited for type or types,[list [list audio [list .wav .aiff]]]
would just give you .wav and .aiff types. Not quite an abstraction despite what the name suggests, I realized that formatting the lists would be a pain and decided not to bother, will make a plugin version later. -
@willblackhurst Finally got a chance to finish this up. Got it working as an abstraction and added a few other features for both save and open dialogs. Also has the nice side effect that each instance remembers where in the file system it was when last used so decreases some of the headaches of [openpanel] and [savepanel]. Think I got all the bugs out. Requires [hcs/sys_gui] and a recent enough version of pd to have [file splitname].
spanel_opanel.zip