folder object and quotes


    Nov 04 2009 | 9:47 pm
    Hey everybody, I'm not sure whether this is a small error on my part or something more major. This is my first forum post, so bear with me!
    I'm trying to get a folder object to read the contents of a folder and dump them into a umenu (as advertised in the folder.maxhelp file); however, even the help file can't send the list of folder contents unless there are quotes around the folder path, a la:
    { "boxes" : [ { "box" : { "maxclass" : "newobj", "text" : "folder "./Cycling '74/max-help"", "fontsize" : 11.595187, "numoutlets" : 2, "outlettype" : [ "", "int" ], "fontname" : "Arial", "id" : "obj-18", "patching_rect" : [ 90.0, 267.0, 163.0, 20.0 ], "numinlets" : 1 }
    } ] }
    You'll notice that the object puts quotes around the file path. I want folder to do this path:
    { "boxes" : [ { "box" : { "maxclass" : "newobj", "text" : "folder ./ONTOarchive/movA", "fontsize" : 11.595187, "numoutlets" : 2, "outlettype" : [ "", "int" ], "fontname" : "Arial", "id" : "obj-14", "patching_rect" : [ 104.0, 392.0, 153.0, 20.0 ], "numinlets" : 1 }
    } ] }
    And when I try to add the quotes back in (as that seems to be the only way to get folder to respond at all) Max automatically deletes them!! wtf? I have discovered that this is true for all objects and messages.
    Can someone let me in on how to accurately use folder and/or what is up with the quote system?
    Thanks much for your thoughts!

    • Nov 04 2009 | 10:09 pm
      SO since posting I've figured out the quote situation (it deals with spaces in folder names), but the issue still exists: folder doesn't respond to anything except in the help file. Max documentation doesn't help. Here's my (ridiculously simple) patch:
      { "boxes" : [ { "box" : { "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "id" : "obj-10", "outlettype" : [ "bang" ], "patching_rect" : [ 182.0, 116.0, 20.0, 20.0 ] }
      } , { "box" : { "maxclass" : "umenu", "fontsize" : 12.0, "items" : [ ], "numinlets" : 1, "numoutlets" : 3, "fontname" : "Arial", "id" : "obj-6", "outlettype" : [ "int", "", "" ], "types" : [ ], "patching_rect" : [ 182.0, 175.0, 100.0, 20.0 ] }
      } , { "box" : { "maxclass" : "newobj", "text" : "folder ./ONTOarchive/movA", "fontsize" : 12.0, "numinlets" : 1, "numoutlets" : 2, "fontname" : "Arial", "id" : "obj-1", "outlettype" : [ "", "int" ], "patching_rect" : [ 182.0, 147.0, 158.0, 20.0 ] }
      } ], "lines" : [ { "patchline" : { "source" : [ "obj-10", 0 ], "destination" : [ "obj-1", 0 ], "hidden" : 0, "midpoints" : [ ] }
      } , { "patchline" : { "source" : [ "obj-1", 0 ], "destination" : [ "obj-6", 0 ], "hidden" : 0, "midpoints" : [ ] }
      } ] }
      And the Max Window confirms that the folder does indeed exist. But no information is pushed to the umenu when it is banged. Why?
    • Nov 04 2009 | 10:34 pm
      Hi and welcome to the forum,
      Can't be sure this is your issue but at a guess.....
      folder only looks for cetain types of files (those you ask it to look for) - by default those are text files and max binary files (patches).
      If you want it to look for something else you'll need to send it a types message. The help file and reference have more details.
      BTW - there is a better (prefered) way to post max 5 patches to the forum which makes them smaller using the "copy compressed" method. There is more detail here:
      Hope this helps
      Alex
    • Nov 04 2009 | 10:56 pm
      Hey thanks for the reply Alex,
      I was worried that this was the case, I'll figure it out.
      And thanks for the info about Copy Compressed, I feel more savvy already!
      patrick