Show Select File Dialog |
Presents the user with a standard dialog and displays all files in a directory.
Syntax
Show Select File Dialog [ Select ; Result ; Prompt ; InitialFolder ;
Allow multiple selection ; Show invisibles ;
Allow package selection ; Allow navigate into packages ]
Options
Select entire contents | replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field |
Result | file path for the selected file |
Prompt | the prompt that will be displayed to tell the user which file to select |
InitialFolder | (optional) the file path to the folder where the dialog initially starts |
Allow multiple selection | allow the user to select multiple files in the dialog |
Show invisibles | shows invisible files in the selection dialog |
Allow package selection | (macOS) Allow selection of macOS packages, like application packages |
Allow navigate into packages | (macOS) Allow macOS packages, like application packages, to be opened and navigated |
Returned Result
Data type returned
Text
Result
The function returns a full path for the selected file to be used with one of the file manipulation functions.
If the user cancels an error code of “$$-1” is returned.
Originated in
Troi File Plug-in 9.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
Filtering on macOS is now the same as on Windows. To change the default filtering see the TrFile_SetDefaultType function, or take a look at “Filtering Files” in the example databases.
NOTE: macOS packages, like application packages, are actually folders, so this will return a path to a folder!
When the option “Allow multiple selection” is added you can use the Command key on macOS or the Control + Alt key on Windows to select or deselect extra items. To select a contiguous group of files at once, click on the first file, then hold Shift and click the last one and all files are selected.
Each selected file is returned on a new line.
Example
On macOS:
Show Select File Dialog [ Select ; Result: MyFileName ; "Please choose a file to import" ;
"Mac HD:Solution Files:Import:" ]
Show Select File Dialog [ Select ; Result: MyFileName ; "Please choose a file to import" ; "Mac HD:Solution Files:Import:" ;
Allow package selection ]
Or on Windows:
Show Select File Dialog [ Select ; Result: MyFileName; "Please choose a file to import" ;
"C:\Solution Files\Import\" ]
This will start the selection at the folder “Import” in the “Solution Files” folder.
It returns “HD Mac:Text files:My Letter” if the user selects that particular file on macOS. On Windows it may return “C:\Text files\My Letter”.
Related script steps
Show Save File Dialog |
Show Select Folder Dialog |
Related function
TrFile_SelectFileDialog |
Related topics
Troi File Plug-in online help (overview)