Forums > MaxMSP

OSX standalone search path trouble

July 9, 2010 | 9:37 pm

Hi all,

I’ve been trying to get a pattrstorage object to automatically read and write a file in a standalone i’ve created. It works fine in windows but the search path for OSX seems to be messed up. I want to save the file in the support folder. I’ve pasted the code i’m using below, can anyone see where i’m going wrong?

Thanks,
Chris

– Pasted Max Patch, click to expand. –

July 10, 2010 | 5:30 am

This is apparently a known problem. There are a couple of other threads about this including http://cycling74.com/forums/topic.php?id=27136 . There is some sort of issue with standalones on the Mac and file locations, particularly ones set to autowatch in pattrstorage. Hopefully the upcoming update will fix it.


July 10, 2010 | 9:01 pm

Thanks for letting me know. Did you manage to find an adequate workaround?


July 10, 2010 | 10:46 pm

Nope, not yet. I’ve been waiting for a fix.


July 12, 2010 | 1:50 pm

Hi – I’ve been having the reverse situation — saving with no problem in a Mac standalone, but failing in a windows build, so perhaps we can help each other out. there are a couple of problems with your patch:

– the loadbang always writes the .json file on load, even before reading it,so even if you write successfully when you close the patch, as soon as you open it, you write empty storage data over it. I imagine this would be a problem on any platform.

– Your trigger at the top sends a read message to the pattrstorage, immediately followed by a 1 to recall the data. Depending on sunspot conditions, that number may hit the pattrstorage object before the file is read, so it’s safest to use a successful read message from the psto as a test condition before you try to recall (will be clear if you look at the patch)

– it is also best to turn off the autorestore attribute when manually loading like this.

Have a look at the patch below — settings restore in an application for me. Now my question for you is: in windows, are you saving your .json file in the support folder as well? Although I’m using the same structure as below, more or less, I always get a -1 error when trying to write. You can look at my thread…

http://cycling74.com/forums/topic.php?id=27480

M

– Pasted Max Patch, click to expand. –

July 14, 2010 | 9:46 pm

Great! Thanks Mattyo – that seems to work perfectly. Below is what I am using to save in windows. And yes, the json is being saved in the support folder.

– Pasted Max Patch, click to expand. –

July 15, 2010 | 2:56 am

thanks, Chris — as it turns out I had botched something in my "what platform am I running?" routine — since windows & mac don’t return the same level of depth. (windows gives you the level of the .exe, mac gives you the level of the app, which is in fact one level higher), and I had done sme stupid copying/pasting.

In your patch, does a path message to thispatcher return something in a Windows standalone? doesn’t do it in Mac…

fwiw, here’s a slightly more sleek version of the patch for you.

M

– Pasted Max Patch, click to expand. –

July 15, 2010 | 9:32 am

The "path" message to [thispatcher] will not work in standalones, you need to use the "sendapppath" message to max itself. Search the documentation or here on the forum for how it works.

lh


July 15, 2010 | 12:35 pm

Actually, "sendapppath" is needed for mac standalones but "path" is needed for windows standalones.


Viewing 9 posts - 1 through 9 (of 9 total)