How to display hidden files in a open files dialog box?

Hi,
I’m looking for how to display hidden files (fade/transparent view) in a dialog box “ShowOpenFileDialog” and “OpenFileDIalog”.
Thanks
Dan

Well, if you use OpenDialogMBS class in MBS Xojo Plugins, there is a property to show invisibles.
The built-in class doesn’t do it.

1 Like

199€ pour one customize OpenDialog box ? Just Buy one individual library possible ?

Yes, Util plugin has an order link to get only that one: Order Util Plugin license

But usually you will start using more stuff soon, so the Complete set may be good.

You might try calling the COM/OLE/WinAPI file selector, if Windows Explorer has already been set to show hidden files.

The call is GetSaveFileName in “comdlg32.dll”
I don’t have a worked example to hand (it needs a struct declared), but there is likely one ‘out there’ already

Sorry, it is for macOS !

Thank you, I think I’m considering buying the pack in the short term.

Hi @Christian_Schmitz

#1 : I try it OpenDialogMBS in “MBS Util Plugin” but the dialog box don’t show the files, made invisible with Xojo’s “Visible = true” function, they are displayed as normal files because they do not have a “.” (dot) before their name !
#2: Does MBS have a function to add a dot point (".) in front of the name of a file/folder?
Thanks very much

I am not having an issue with OpenDialogMBS and showing invisible items. This is working as expected:

var f as FolderItem = SpecialFolder.Desktop.Child("test")
f.CreateFolder
f.Visible = false

var o as new OpenDialogMBS
o.ShowHiddenFiles = true

call o.ShowDialog

Do you have a better description of what you’re expecting and what’s actually happening?

#2: Does MBS have a function to add a dot point (".) in front of the name of a file/folder?

A plugin for that would be overkill.

var f as FolderItem = // wherever you acquire the folderitem
f.Name = "." + f.Name
1 Like

You need to set Folderitem.Visible to false to hide files.

If a file called RED has been made invisible but doesnt have a . at the front, the filename is still RED

If you literally change the filename by adding a . so that it becomes .RED you may well break something that expects to find a file called RED
Dont do that.

If you want the file selector to show a (not really there) ‘.’ in front of the word RED, you will need to write one yourself.

If you want hidden files to show up and be selectable, then the file name the user is choosing is RED and you are choosing for it not to matter to them if the file is set to be visible or not.

Next time, please post in the Targets/MacOS channel. It is much easier for others to help.

Actually, it is there.

It was not there an hour ago, maybe OP moved the topic or one of the mods.

Ok. Would be nice to have the forum showing moves.

By the way, this thread talks about listing hidden files without a plugin or declares:

If you want to do all this without plugins, I put together a pair of classes and put them here:

1 Like

Hello @Christian_Schmitz
I wasn’t clear enough about my point :slight_smile:
Invisible files displayed in “OpenDialogMBS” are not grayed out and therefore how to differentiate them from visible files? This makes their selection very difficult in large cases in particular. Finder and even ForkLift and others gray out invisible files for easier viewing (see screenshots attached). Can we remedy this?
View hidden files with OpenDIalog MBS

View hidden files with ForkLift for exemple

That is a feature of Finder, not the system file selector (NSOpenPanel)

Here’s the same thing written in obj-c:

This looks logical to me, as open dialogs already grey out files that aren’t of an accepted type.