Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OPENFILEDIALOG$ question on a Mac
#7
(12-23-2023, 12:21 AM)NakedApe Wrote: Thanks, mnrvovrfc. Well in the Mac world this works fine:

file$ = _OPENFILEDIALOG$("Open Files", "", "*.txt|*.bas|*.mp3|*.ogg|*.wav", "Files", 0)
IF file$ <> "" THEN _MESSAGEBOX "Information", "You selected " + file$

I tried it a bunch of different ways. The second parameter can be just "" here (which = current directory/folder), but without specific files listed in the third parameter there are no results. Also unfortunately "*.*" doesn't work on a Mac, but "*.xxx" does - weird. Thanks again.

You guys should take a moment to look at this:  https://en.wikipedia.org/wiki/Filename#C...imitations

Of particular note, in this case, is the list of reserved characters which can't be used in file names:   :

Now, in case that isn't clear above, the ONLY reserved character is the colon.  You can't name a file "foo:2", but you CAN name your file "foo.*", if you want to!

So when you search for "*.*" on a Mac, what you're searching for is the singular file called star-dot-star!  That's a filename and NOT a directive to look for wildcard-dot-wildcard.  Now, some file explorer/openers run under the assumption that nobody is ever going to be silly enough to name a file "*.*" and will use them for wildcards, but apparently the library we use for the open dialogs doesn't make that assumption.  (And, honestly, it shouldn't, as star-dot-star IS a perfectly valid name for a Mac file.)

I'm also curious if you can just completely omit that parameter, and have it work for you.  But, as the file system is designed, it doesn't surprise me that star-dot-star isn't working as you'd expect.  It IS working; it's just working by showcasing that no files with that name are in the directory specified..  Wink
Reply


Messages In This Thread
OPENFILEDIALOG$ question on a Mac - by NakedApe - 12-22-2023, 09:36 PM
RE: OPENFILEDIALOG$ question on a Mac - by bplus - 12-23-2023, 12:21 AM
RE: OPENFILEDIALOG$ question on a Mac - by SMcNeill - 12-23-2023, 12:47 AM
RE: OPENFILEDIALOG$ question on a Mac - by bplus - 12-23-2023, 12:30 AM



Users browsing this thread: 2 Guest(s)