Forums > MaxMSP

saving data (coll) within a built standalone?

May 5, 2009 | 10:41 pm

Is there a way to save data within a built standalone app? The coll object allows for writing a file but not for defining a path and will write a text file to the folder containing the standalone. i would like to write to a file within the standalone app/folder.


May 5, 2009 | 10:55 pm

In a standalone this should report where the runtime version of max is, in the package you have built to be your application (on mac at least). You can then use [sprintf] to format a specific name and location to send to [coll].

lh

– Pasted Max Patch, click to expand. –

May 5, 2009 | 11:42 pm

nice!

but..

It appears to report the location of the standalone and not the runtime within the standalone. Formatting the standalone-name as folder in sprintf doesn’t work and results in the file being written beside the standalone. It would be nice if i could write to a file within the standalone(contents). I’d prefer not to write a pref file somewhere else and keep everything contained within the app.

or is this impossible?

– Pasted Max Patch, click to expand. –

May 6, 2009 | 12:03 am

It works for me if you change the sprintf to something like:

[sprintf symout %s%s.app/Contents/support/%s.txt]

making sure the ".app" bit is included might be what you were missing.

lh


May 6, 2009 | 12:17 am

working! Thanks.

I wasn’t pointing to something like Contents/support but the root/app folder which probably is a nono.


May 6, 2009 | 12:27 am

That might have been the problem, generally Contents/support is where you want to bundle all the related bits that go with your app, even making your own subfolders inside "support" is not a problem. If you want to allow users to add their own folders then look at [filepath] which can temporarily add folders to you app’s search path.

lh


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