Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Fix: Multiple extension filter wasn't working on MacOS for File() and… #13

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

SolarLune
Copy link
Contributor

… FileMulti().

Fix: Couldn't use same filter string across all platforms (as MacOS expects "jpg" instead of "*.jpg" for a filter string, unlike Windows and Linux). Now the characters are stripped down for Mac.

… FileMulti().Fix: Couldn't use same filter string across all platforms (as MacOS expects "jpg" instead of "*.jpg" for a filter string, unlike Windows and Linux). Now the characters are stripped down for Mac.
@SolarLune
Copy link
Contributor Author

SolarLune commented Feb 11, 2020

Whoops, sorry, forgot to remove a fmt import that I added when testing. Fixed and ready to merge.

@gen2brain gen2brain merged commit b9c2664 into gen2brain:master Feb 11, 2020
@miguelpruivo
Copy link

@SolarLune regarding this, how do you split multiple file extensions on MacOS? I've been trying with jpg, jpeg, png etc. but it doesn't seem to work at all. What's the correct pattern?

Thank you!

@gen2brain
Copy link
Owner

gen2brain commented Apr 17, 2020

@miguelpruivo did you tried to just separate with spaces, not commas? It should also be possible to use "Uniform type identifiers", i.e. just use public.image or for example public.text.

https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1

@SolarLune
Copy link
Contributor Author

SolarLune commented Apr 17, 2020

Hello! I attempted to make this clear in the documentation for the function, but yeah, it should work with "*.png *.jpg", I believe...? And yeah, it should be possible to use type identifiers, though I don't believe it works with "unknown extensions" (i.e. if you name a file .pop and then try to filter out ".pop" files on Mac).

@miguelpruivo
Copy link

@SolarLune have you tried on MacOS in that format with success? It only seems to work with a single extension for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants