TrFile_SelectFolderDialog (function reference)

By May 1, 2017 May 22nd, 2019 Online Help, Troi File Plug-in
Troi File Plug-in > Functions reference > TrFile_SelectFolderDialog
Troi File Plug-in for FileMaker Pro

TrFile_SelectFolderDialog

With this function the user can select a folder on disk. The function will show the user a standard dialog with the hierarchy of folders on the computer.

SyntaxFunction badge

TrFile_SelectFolderDialog ( switches ; prompt ; { initialFolder } )

Parameters

switchesreserved for future use, leave empty or set to "-Unused"
promptthe prompt that will be displayed to tell the user which folder to select
initialFolder(optional) the path to a folder on disk that will be used as the starting point for the selection dialog

Returned Result

Data type returned

Text

Result

The function returns a FileSpec for the selected folder. This folder can be used with other functions of the plug-in.

If the user cancels an error code of “$$-1” is returned.

Originated in

Troi File Plug-in 3.0

Compatibility

FileMaker Pro 14 to 18

Example

Set Field [ result ; TrFile_SelectFolderDialog ( "-Unused " ; 
			"Please choose a folder where you want to put the files." ; " C:\Data\" ) ]

This will present a folder selection dialog. The dialog initially shows the folder: “C:\Data\”. The user can then select a folder and click on OK. The function returns with the path to the folder, for example: “D:\MyFiles\Databases\”.

Example 2

We assume that in your FileMaker file the following fields are defined:

  gFolderPath		Global, text
  gInitialFolder	Global, text

gInitialFolder should contain the path to a folder, for example “D:\Logs\Data\” (Windows) or “Mac HD:Logs:Data:” (Mac OS). In a script add the following script step:

Set Field [ gFolderPath ; TrFile_SelectFolderDialog ( 
                "-Unused" ; "Please choose a folder where you want to put the files." ; gInitialFolder ) ]

After the dialog gFolderPath will contain the path to the selected folder.

Related functionsFunction badge

TrFile_ListFolder
TrFile_SelectFileDialog

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 14 to 18 –> TrFile_SelectFolderDialog (filep4272) 2019-0522 17:11:47