diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h index a720b63a3c..a978891c38 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h @@ -87,11 +87,12 @@ public: file. If you create such a temporary file, you need to delete it yourself, once it is not needed anymore. - @param filePatternsAllowed a set of file patterns to specify which files - can be selected - each pattern should be - separated by a comma or semi-colon, e.g. "*" or - "*.jpg;*.gif". An empty string means that all - files are allowed + @param filePatternsAllowed a set of file patterns to specify which files can be + selected - each pattern should be separated by a comma or + semi-colon, e.g. "*" or "*.jpg;*.gif". The native MacOS + file browser only supports wildcard that specify + extensions, so "*.jpg" is OK but "myfilename*" will not + work. An empty string means that all files are allowed @param useOSNativeDialogBox if true, then a native dialog box will be used if possible; if false, then a Juce-based browser dialog box will always be used diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 0bb954c050..8386fa2763 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -37,6 +37,12 @@ static NSMutableArray* createAllowedTypesArray (const StringArray& filters) for (int i = 0; i < filters.size(); ++i) { + #if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) + // From OS X 10.6 you can only specify allowed extensions, so any filters containing wildcards + // must be of the form "*.extension" + jassert (filters[i].indexOf ("*") <= 0); + #endif + const String f (filters[i].replace ("*.", "")); if (f == "*")