relative paths

    May 01 2006 | 12:45 pm
    Hey guys,
    does anyone know how to set up relative paths that aren't within the max application folder? i want to select a folder that is in the same level as my patch and read the relative path, so i just get the folder name rather than the absolute path?
    please help.

    • May 01 2006 | 2:35 pm
      path-> [thispatcher]
      use [sprintf %ssubfolder/subsubfolder] to concat the rest of the folderpath.
      best, thijs
    • May 01 2006 | 2:43 pm
      ok i might missunderstand something and in that case please excuse me in advance. Did you have a look at the objects relativepath absolutepath and filepath ?
      Sorry if my answer if too simple, maybe i got something wrong. HTH. Seb.T
    • May 01 2006 | 2:54 pm
      yeh i have,
      but the object relativepath only works for within the max application program. so im having a bit of difficulty trying to just get a relative path from the main folder.
      any ideas? dave
    • May 01 2006 | 3:03 pm
      hi thijs,
      here is what i have...sorry i couldn't figure out how/where to put in your suggested object
      Im trying just to get the relative path.
      hope you can help?
      cheers, dave
    • May 04 2006 | 1:30 pm
      javascript is good for sorting this kind of thing out:
      appFilePath = "";
      post("path: " +this.patcher.filepath);
      var tmp = this.patcher.filepath.split("/");
      post("Filepath: "+ this.patcher.filepath + "n");
      if (tmp[tmp.length-1] != "MacOS") tmp.pop(); //remove patcher name
      for(var c=0; c { appFilePath += tmp[c] + "/"; }
      newFilePath = appFilePath + "yourDirectory/";
    • May 04 2006 | 2:14 pm
      you cant get relative paths that way.
      if you have
      there is no relative path between max runtime and the file because it would include going 2 levels up. if you want to build an app which uses a "samples" folder relative beside the app, you could incluide a "samples" folder in your search path during programming.