Preferences folder filepath on OSX for pattrstorage

    Nov 27 2009 | 8:28 pm
    I have made a standalone. On OSX, I would like to store some settings in a pattrstorage in an xml file in the User/Library/Preferences folder.
    How do i get that filepath irrespective of where on the system my standalone is running from?

    • Nov 27 2009 | 8:48 pm
      Try this. Super handy:
    • Nov 27 2009 | 9:31 pm
      you can use the shell object (found via to get the user's name with the "whoami" command. you can construct the path to the preferences folder with this information.
    • Nov 28 2009 | 9:57 am
      Thenks for the replies.
      Andrew: I have tried messing around with the different filepath objects in Max, problem is that it is hard to get consistent results, they are pretty much all dependent on where on the system the patch is running from. Trying out your patch running from the harddrive will not get me a user name, just Harddrive:/my_patch/
      Robtherich: That seems nice, but I really like to just use the stock Max objects, and avoid third party externals. For portability.
      OSX filpath convention is using a tilde to take you to the current users top level folder, but I can't get Max to recognise it. That would be: ~/Library/Preferences
      Now that is super handy! Problem is I can't get it to work.
    • Nov 28 2009 | 7:04 pm
      I've been playing with this - though the mxj syscommand by Topher Lafata. Since it is an mxj, it should work on any mac, just bundle the mxj with the patch or app.
      (but the share page where you can download it does not seem to be back up yet)
      I think this should work pretty universally on OS X. There are a few number boxes and an autopattr so you can test.