CREATING a new Folder
I have searched through the docs and I have done a forum and google search and cannot seem to find the answer for this seemingly simple question.
How can Max CREATE a folder?
I want to create a folder for several performance files grouped into time-stamped categories that will be stored inside of this newly created folder.
In other words, the folder will be named something like the following:
YYYYMMDD-HHMMSS
And inside of that folder will be several files all related to the performance from that time period.
It seems like it should be so simple but apparently it is not.
The logical choice would be the 'folder' sub-patcher, but there doesn't seem to be an option to 'write' a new folder... you can only 'read' from it.
Any help with this?
Thanks!
If you don't mind using Java, you could use this : https://cycling74.com/tools/mxj-filesys-v0-2-3/
Under OSX, you could also use the shell object.
It looks like SHELL hasn't been updated in a long time.
It still references using a universal binary.
Am I to understand that there is no way to create a folder from within MAX without using an external plugin/program?
Larry
I built my own shell external for OS/X a few years ago, it had a couple of features I needed that weren't in previous shells.
You can find it at http://max4eigenharp.com/?p=83
This object doesn't search the path looking for programs so you need to send it an entire path to file as the first item of your message to make it work. E.g.,
/bin/mkdir
rather than just
mkdir
Maybe it will be helpful.
Awesome!
I'm looking forward to trying it out.
BTW, your site looks great. Nice treatment.
L
A little late to the party - I use [createfolder], which is one of the jasch objects
Can you be more specific as to how you used [createfolder]?
If I wanted to created a folder in Documents called Mark how would I go about doing so?
As per the Help file, all you need to do is to send the full path of the location you want to create your new folder
eg "Macintosh HD"/Users/(username)/Documents/
with the name of the new folder added on the end - I use [sprintf %s/%s] to do this, with the name of the new folder going into inlet 2 and the path into inlet 1 (probably going through a [tosymbol] first.
If your Documents folder is one that Max already sees (i.e. you've included Documents in File Preferences) then you should be able to use [absolutepath] to find the full path to Documents. I store that in a [zl reg] and then bang it into inlet 1 of the sprintf when I want to do the actual create. I'm mostly doing this to create new folders inside a Project related folder, so I can use [absolutepath] without any fiddling around. The alternative is to just figure out the path to the Documents folder (you can see the path in the bottom of a Finder window if you select the Documents folder in the Finder documents pane) and store it in a message box.
No time this morning to look at this, but a couple of things to check are...
..Search for , download and install the createfolder objects, making sure they are in Max's search path. (However you do that - I put them into a Packages type folder. If you have problems finding the objects (I'm not sure that maxobjects is working at the moment), let me know and I can post or send my version late today).
..It's quite an old object, so is probably 32 bit only. Are you running Max in 32 or 64 bit mode?
Jasch kindly posted link for 64 bit externals, just search for it.
http://www.jasch.ch/dl/default.htm
Mac only.
If You need help forming PATH/Timestamp symbol just ask.
If you are on a Mac: [shell] works well here, I create and delete folders and files at any location. The only problem is to find the proper encoding for paths, especially with blank spaces. You cannot check this directly in Max because of it's string display behavior.
Hi, I guess you might have figured out a solution for this but to anyone else who might be wanting to create new folders with max it is quite easy using the aka.shell object on mac. I've posted a patch with an example that works for me.