Problem file browsing on OSX - How to use a filter function?
I'm working with file browsing atm using the File objects in JSX and the openDlg -method and quite frankly, this is driving me insane.
Did some crazy person decide that it was a good idea to have the filter-flag on the openDlg -method totally different for Win and OSX? On windows you use a string for the filtering, on OSX it want's a function!
I've checked the documentation and also searched this forum and I can't even find an example of how to set this up so that it works for both Windows and OSX?
Ok so I've found the syntax, but it still doesn't make sense.
fileMask = function(file){file.name.match(/\.psd$/i) ? true:false;}
Here we have the psd-extension hardcoded into the regular extension. But what if we want it to be a variable? And what if t he file doesn't exist yet.
Basically what I want is for the user to:
Browse to a folder
set a file name
save.
The extension type should be locked!
Compared to the windows way of doing things, the OSX way of using a filter function is nonsensical, overly complex and downright annoying!
EDIT: I also discovered that you can't write a file name on OSX unless the file already exists. Come on! Is this the wrong dialog type or something???