Show Select File Dialog
Presents the user with a standard dialog and displays all files in a directory.
Show Select File Dialog [ Select ; Result ; Prompt ; InitialFolder ;
Allow multiple selection ; Show invisibles ;
Allow package selection ; Allow navigate into packages ]
|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
|file path for the selected file
|the prompt that will be displayed to tell the user which file to select
|(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
|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
Data type returned
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.
Troi File Plug-in 9.0
FileMaker Pro 16 to FileMaker Pro 2023
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.
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