[Tip/Trick] FileOpenBox "File mask" paramter explanation - Forum

Forum Navigation
You need to log in to create posts and topics.

[Tip/Trick] FileOpenBox "File mask" paramter explanation

The FileOpenBox method has a File mask: parameter. This parameter's syntax may be confusing at first, especially when the VisualNeoWin help topic explains it poorly.

This parameter will control what the selections Files of type: dropdown box in the bottom of the dialog box will have. This dropdown can be used to filter what is shown in the current directory to the dialog box.

The is an example to show how syntax goes as follows:
Text Based Document (*.txt, *.rtf)|*.txt;*.rtf|Text Document (*.txt)|*.txt|Rich Text Document (*.rtf)|*.rtf|Any File (*.*)|*.*

Which results in:

Spoiler


 

Looking at the example, notice how this has parts.
The first part (file mask name) is the name that should appear in the dropdown. Like "This is a file filter test 1"; it can literally be anything.
The second part (file filter) is the file filter. The * represents wildcard which literally means anything. Unless you want to filter for a specific file with a specific file name, you should use a wildcard before the extension. This can literally be any extension, for example: *.pub. This will make it so only pub files will only appear out of all the other files in a folder that the dialog is viewing.

The vertical bar (|). is used to separate the file mask name, and the actual file filter the name represents (the first and second part, respectively). The vertical bar (|) is also used to separate one file mask set from another (so you can use more than one file mask in the dropdown. The example used above will show Text Based Document (*.txt, *.rtf), Text Document (*.txt), Rich Text Document (*.rtf), and Any File (*.*) as selections in that dropdown.).
Semi-colon (;) is used to separate two or more file filters if you want to match multiple types of files via one file mask. For the above example, *.txt;*.rtf will match both txt and rtf files when the file mask Text Based Document (*.txt, *.rtf) is selected via the file open dropdown.

Note: You can use *.* to match everything anything (don't filter). Try to experiment with this. An example would be Custom File Mask 1 (testfile_*.txt)|testfile_*.txtwhich will only show files that are named testfile_(anything)with the extension of txt. For this example, testfile_1.txt would be shown but testfile1.txt would not be shown.

Bonus: Here is a filter I made for HTML and HTM, HTML, HTM, or Any File:
Hypertext Markup Language (*.HTML, *.HTM)|*html;*.htm|Hypertext Markup Language - Proper Extension (*.HTML)|*.html|Hypertext Markup Language - Improper Extension (*.HTM)|*.htm|Any File (*.*)|*.*

luishp, Vadim and 4 other users have reacted to this post.
luishpVadimDaviddeArgentinaluizproforma.guyotdanito

Hi overthere!

I just discovered this messages, and looks very fine...

Thanks a bunch for the explanation, it is very useful..

By the way, i just remember an old plugin called NeoOpenIMGDialog, that allow to do a preview selecting an image.

If you are interested, please tell me and i will send you the plugin.

 

greetings from Buenos Aires,

David de Argentina

Uploaded files:
  • You need to login to have access to uploads.
Vadim and proforma.guyot have reacted to this post.
Vadimproforma.guyot

Bonsoir David de Argentina,

Le plugin appelé NeoOpenIMGDialog, qui permet de faire un aperçu en sélectionnant une image, je ne le connaissais pas.
Je suis intéressé par ce plugin, si cela est toujours possible je souhaiterais l'obtenir.
Merci par avance à toi.

proforma.guyot@orange .fr

Claude GUYOT
NeoBook in French Version: 5.8.7
"Thank you very much for loving this software as much as I do."
"Merci beaucoup d'aimé ce logiciel autant que moi."

Mes Amis,

Créer un dossier avec des images avec des formats .png .jpg .gif ...
Et avec cette Pub NeoBook/Visualneo rechercher votre dossier et sélectionner le !
Vous obtenez un dipatch par extantion fichiers et vos visuels.

Résultat d'origine/ Natif : NeoBook/Visualneo, et qui ouvre des résultats, autres que ... .png .jpg .gif ...
Sur .txt .xls ...

Claude GUYOT
"Thank you very much for loving this software as much as I do."
"Merci beaucoup d'aimé ce logiciel autant que moi."

Uploaded files:
  • You need to login to have access to uploads.
Quote from proforma.guyot on July 27, 2021, 8:12 pm

xchellx merci pour ce post,

Une idée avec un code Natif NeoBook/Visualneo, et qui ouvre des résultats, autres que ... .png .jpg .gif ...
Utilisable avec  .txt .xls ...

Claude GUYOT
"Thank you very much for loving this software as much as I do."
"Merci beaucoup d'aimé ce logiciel autant que moi."

 

What you ask is what you get....   ;-)

 

 

 

 

 

 

 

 

Uploaded files:
  • You need to login to have access to uploads.
proforma.guyot has reacted to this post.
proforma.guyot

David,

Thanks for the resource.

Historically we have icons in code or plugin and even both for resources or answers on solutions to our favorite programming harbor.

I am and remain in admiration of our characters; and you are part of it ...

--------------------

Merci pour la ressource.

Historiquement nous avons des icônes en code ou plugin et mème au deux à la fois pour des ressources ou réponses sur des solutions à notre rade de programmation préféré.

Je suis et reste admiratif à nos personnages; et tu en fais parti ...

Claude GUYOT
"Thank you very much for loving this software as much as I do."
"Merci beaucoup d'aimé ce logiciel autant que moi."