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
This is apparently a known problem. There are a couple of other threads about this including https://cycling74.com/forums/autowatch-not-working-in-standalone . 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.
Thanks for letting me know. Did you manage to find an adequate workaround?
Nope, not yet. I've been waiting for a fix.
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...
M
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.
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
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
Actually, "sendapppath" is needed for mac standalones but "path" is needed for windows standalones.