OSX standalone search path trouble

Jul 9, 2010 at 9:37pm

OSX standalone search path trouble

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. –
#51297
Jul 10, 2010 at 5:30am

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.

#183941
Jul 10, 2010 at 9:01pm

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

#183942
Jul 10, 2010 at 10:46pm

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

#183943
Jul 12, 2010 at 1:50pm

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. –
#183944
Jul 14, 2010 at 9:46pm

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. –
#183945
Jul 15, 2010 at 2:56am

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. –
#183946
Jul 15, 2010 at 9:32am

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

#183947
Jul 15, 2010 at 12:35pm

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

#183948

You must be logged in to reply to this topic.