Forums > MaxMSP

Relative filepath to folder in standalone

May 9, 2012 | 8:00 am

I’m trying to open a folder of audio files within a standalone. For the moment I’m using [opendialog fold] and choosing it, but for the standalone I want the folder to populate a [umenu] automatically.

Any ideas?

– Pasted Max Patch, click to expand. –

May 9, 2012 | 5:41 pm

try the message to max:

;max sendapppath app-path-name

then have a [receive] object named app-path-name (or anything you want, just the same in both places). this will give you the folder path of the standalone. you can then use [sprintf] or [combine] to add the subfolder path to it, then [prepend prefix] to [umenu].

note that getting the path this way is different than the "path" message to [thispatcher], which only works in a .maxpat file, not a built application. It’s a little confusing and you have to do it differently for each, but it works fine. It’s also a bit of a pain because during testing (in the .maxpat before building the application) it won’t work! So you have to build to test it fully.

There are some other solutions to this on the Forums too, including some javascript examples, which you can look into as well if needed. I think the idea there was to have it work in either case—.maxpat or application, without needing to make a separate version for each.

Note that this will also be an issue if you want to save files as well—they don’t auto-save in the same places, typically. So you need to create the save filepath differently for the standalone too, and test it in the same way—with the standalone itself.


May 9, 2012 | 5:50 pm

Here’s a thread on getting the path to your standalone:

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


May 9, 2012 | 8:47 pm

Thanks guys! Got it sorted now it seems. Will bring it to another computer tomorrow to see…


July 17, 2012 | 10:47 pm

I was making something similar and figured I would post up my results.


July 17, 2012 | 10:53 pm

Messed up last post sorry,

Attachments:
  1. Other.maxpat

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