Filetypes
Hi, is there any way to give a user-specified set of file extensions to opendialog? Seems that you can only use C74 defined ones...
thx Lee
Check out the fileformat section of Controlling Max with Messages in the help documentation.
You can send the message to max:
;max fileformat .lee TEXT
and Max will read .lee files as text files and list .lee files in the opendialog
There is also a max-fileformats.txt file that I assume is editable...
great, thanks for the pointer...
cheers
Hi, whatever I try, I always get *.* appearing in my opendialogs - even then help page for file types opens the dialog with *.* whatever I select in the dropdown...
Can someone confirm if this is working for them? thx
What context are you getting *.* ? Which OS? I don't see that… but I'm using a third-party file manager on OS X so that might be the reason.
If you want to exclusively open .lee files send the message to Max:
;
max fileformat .lee "LEE "
Then send the message LEE to open dialog. Only .lee files will be selectable in the directories.
To maintain the setting after quitting Max you can edit the max-fileformats.txt file with:
max fileformat .lee "LEE " 0 "Lee file" textfile;
-
If you want to open .lee files as well as any other text type file, send the message to Max:
;
max fileformat .lee TEXT
Then send the message TEXT to opendialog. All text type files, including .lee files will be selectable in the directories.
To maintain the setting after quitting Max you can edit the max-fileformats.txt file with:
max fileformat .lee TEXT 0 "Lee file" textfile;
-
The above will also work to populate a umenu with the folder object using LEE to define the types attribute.
maybe i´ve missed the point, but what is wrong with using the "types" message or an argument to the object?
maybe I misunderstand how this should work - if I pull up the help for opendialog, and go to the 2nd tab called "file types", there is an example at the top with a load of types in a dropdown into an opendialog - when i select a filetype, e.g. JPEG, in here I would expect the opendialog to open showing *.jpeg files, but I only see it opening with *.*
this is on Windows 7 64-bit.
whatever I send in to opendialog, whether using "types" or other documented mechanisms, I only ever see *.*, i.e. all file types, as the filter...
Lee, create a folder and throw in some JPEGs and PNGs. Then go to the help file, select JPEG and navigate to that folder. Are the JPEG files not the only selectable files? That's how it seems to work in OS X.
Roman, I think the idea is to associate a unique extension with a filetype so that Max will interpret it as such.
If you rename a jpeg with a .foo extension, an object such as fpic won't open it. But if you edit the max-fileformats.txt file with max fileformat .foo "FOO " 0 "Foo example" imagefile;
fpic will open it and opendialogue will exclusively open .foo files with a FOO message.
At least that seems to be the way it works.
Hi, nope, in windows everything is selectable... seems to work on Mac as I would expect it to on Windows... seems like a windows bug, so will raise it - thx for the info
but wouldnt .lee files be all of the same type, say TEXT, anyway? or do you plan to have different types and/or need a check for type.
but oh ... windows ... of course.
Yeah, something like that. Aside from the cool factor of having custom extensions, the contents or formatting could be such that you only want to open certain files. I suppose it could all be handled with the right naming convention, but extensions make it easier to group types.